diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-07-09 01:30:19 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-07-09 01:37:35 -0700 |
commit | eb7892c4019bd5d00175c0eb80eb0c5a47a42ca1 (patch) | |
tree | 4b2c8a1afc827974d57319b37aadf0cf8747b478 /include | |
parent | de9dfbb3859df7cfd0d3b70461459f521e2208e5 (diff) | |
download | gdb-eb7892c4019bd5d00175c0eb80eb0c5a47a42ca1.zip gdb-eb7892c4019bd5d00175c0eb80eb0c5a47a42ca1.tar.gz gdb-eb7892c4019bd5d00175c0eb80eb0c5a47a42ca1.tar.bz2 |
LTO: Properly check wrapper symbol
Add wrapper_symbol to bfd_link_hash_entry and set it to true for wrapper
symbol. Set wrap_status to wrapper if wrapper_symbol is true in LTO.
Note: Calling unwrap_hash_lookup to check for the wrapper symbol works
only when there is a definition for the wrapped symbol since references
to the wrapped symbol have been redirected to the wrapper symbol.
bfd/
PR ld/31956
* linker.c (bfd_wrapped_link_hash_lookup): Set wrapper_symbol
for wrapper symbol.
include/
PR ld/31956
* bfdlink.h (bfd_link_hash_entry): Add wrapper_symbol.
ld/
PR ld/31956
* plugin.c (get_symbols): Set wrap_status to wrapper if
wrapper_symbol is set.
* testsuite/ld-plugin/lto.exp: Run PR ld/31956 tests.
* testsuite/ld-plugin/pr31956a.c: New file.
* testsuite/ld-plugin/pr31956b.c: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/bfdlink.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/bfdlink.h b/include/bfdlink.h index 015370d..f802ec6 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -117,6 +117,9 @@ struct bfd_link_hash_entry /* The symbol, SYM, is referenced by __real_SYM in an object file. */ unsigned int ref_real : 1; + /* The symbol is a wrapper symbol, __wrap_SYM. */ + unsigned int wrapper_symbol : 1; + /* Symbol is a built-in define. These will be overridden by PROVIDE in a linker script. */ unsigned int linker_def : 1; |