diff options
author | Nick Clifton <nickc@redhat.com> | 2023-11-21 09:26:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-11-21 09:26:19 +0000 |
commit | 1c320501655ec8d5077d0a3231652c7d661249bc (patch) | |
tree | 14682d855e58471f07ca95611448ab42ca477934 /bfd | |
parent | a68722065fd544995137677fb0e57c392ef00e0e (diff) | |
download | gdb-1c320501655ec8d5077d0a3231652c7d661249bc.zip gdb-1c320501655ec8d5077d0a3231652c7d661249bc.tar.gz gdb-1c320501655ec8d5077d0a3231652c7d661249bc.tar.bz2 |
Fix: symbols eliminated by --gc-sections still trigger warnings for gnu.warning.SYM
PR 31067
* linker.c (_bfd_generic_link_add_one_symbol): When issuing a warning message, also display a message about the warning not being affected by garbage colleciton.
* ld.texi (Special Sections): New entry in the linker manual. Describes how the .gnu.warning and .gnu.warning.SYM sections behave.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/linker.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1430698..e9f571a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2023-11-21 Nick Clifton <nickc@redhat.com> + + PR 31067 + linker.c (_bfd_generic_link_add_one_symbol): When issuing a + warning message, also display a message about the warning not + being affected by garbage colleciton. + 2023-11-15 Arsen Arsenović <arsen@aarsen.me> * aclocal.m4: Regenerate. diff --git a/bfd/linker.c b/bfd/linker.c index 28fffc3..90dc581 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1784,6 +1784,14 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, { (*info->callbacks->warning) (info, string, h->root.string, hash_entry_bfd (h), NULL, 0); + /* PR 31067: If garbage collection is enabled then the + referenced symbol may actually be discarded later on. + This could be very confusing to the user. So give them + a hint as to what might be happening. */ + if (info->gc_sections) + (*info->callbacks->info) + (_("%P: %pB: note: the message above does not take linker garbage collection into account\n"), + hash_entry_bfd (h)); break; } /* Fall through. */ |