aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-04-08 10:06:43 -0700
committerFangrui Song <i@maskray.me>2022-04-08 10:06:44 -0700
commite07dfa5328b0ca1465ae7b749e1ac2d994741e27 (patch)
tree7faf94e0d8cbde7f89922236941d3e078ebc801e /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parent67acc34e2ad89f18a6d66d72ddc30e77c5aff7d9 (diff)
downloadllvm-e07dfa5328b0ca1465ae7b749e1ac2d994741e27.zip
llvm-e07dfa5328b0ca1465ae7b749e1ac2d994741e27.tar.gz
llvm-e07dfa5328b0ca1465ae7b749e1ac2d994741e27.tar.bz2
[MC][ELF] Improve st_size propagation rule
`.symver foo, foo@ver` creates the MCSymbolELF `foo@ver` whose almost all attributes (including st_size) should inherit from `foo` (GNU as behavior). a041ef1bd8905f0d58e301c6830b183002ff1847 added st_size propagation which works for many cases but fails for the following one: ``` .set __GLIBC_2_12_sys_errlist, _sys_errlist_internal .type __GLIBC_2_12_sys_errlist,@object .size __GLIBC_2_12_sys_errlist, 1080 .symver __GLIBC_2_12_sys_errlist, sys_errlist@GLIBC_2.12 ... _sys_errlist_internal: .size _sys_errlist_internal, 1072 ``` `sys_errlist@GLIBC_2.12`'s st_size is 1072 (incorrect), which does not match `__GLIBC_2_12_sys_errlist`'s st_size: 1080. The problem is that `Base` is (the final) `_sys_errlist_internal` while we want to respect (the intermediate) `__GLIBC_2_12_sys_errlist`'s st_size. Fix this by following the MCSymbolRefExpr assignment chain and finding the closest non-null `getSize()`, which covers most needs. Notably MCBinaryExpr is not handled, but it is rare enough to matter. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D123283
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions