From 11d2f718eb85e809ae4dbc185083947bdfca4eb0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 22 Mar 2005 14:49:16 +0000 Subject: [PATCH] bfd/ * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on .gnu.warning.* sections. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Set SEC_EXCLUDE on .gnu.warning sections. --- bfd/ChangeLog | 5 +++++ bfd/elflink.c | 4 ++++ ld/ChangeLog | 5 +++++ ld/emultempl/elf32.em | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ff69b17e830..046266defbb 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-03-23 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on + .gnu.warning.* sections. + 2005-03-22 Alan Modra * elf32-ppc.c (elf_linker_section_pointers_t): Remove diff --git a/bfd/elflink.c b/bfd/elflink.c index 277395a9b5b..783d9b9ea16 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -3240,6 +3240,10 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) /* Clobber the section size so that the warning does not get copied into the output file. */ s->size = 0; + + /* Also set SEC_EXCLUDE, so that symbols defined in + the warning section don't get copied to the output. */ + s->flags |= SEC_EXCLUDE; } } } diff --git a/ld/ChangeLog b/ld/ChangeLog index 0c8c209b580..1378cb53761 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2005-03-23 Alan Modra + + * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Set + SEC_EXCLUDE on .gnu.warning sections. + 2005-03-22 Alan Modra * scripttempl/elf.sc (SBSS): Don't provide sbss start and end syms. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 1acedb456b2..00805d53d56 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1105,6 +1105,10 @@ ${ELF_INTERPRETER_SET_DEFAULT} /* Clobber the section size, so that we don't waste copying the warning into the output file. */ s->size = 0; + + /* Also set SEC_EXCLUDE, so that symbols defined in the warning + section don't get copied to the output. */ + s->flags |= SEC_EXCLUDE; } } } -- 2.30.2