aboutsummaryrefslogtreecommitdiff
path: root/bfd/cofflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-07-09 06:20:52 +0000
committerAlan Modra <amodra@gmail.com>2011-07-09 06:20:52 +0000
commit0c51100021bb287449cd0796586a7495d76e14bf (patch)
tree65bbc32ae045206821bd4d2de8a5473adc6071fb /bfd/cofflink.c
parentbeabb2c68ff9e09a1141cafd6f0b11ed98343290 (diff)
downloadfsf-binutils-gdb-0c51100021bb287449cd0796586a7495d76e14bf.zip
fsf-binutils-gdb-0c51100021bb287449cd0796586a7495d76e14bf.tar.gz
fsf-binutils-gdb-0c51100021bb287449cd0796586a7495d76e14bf.tar.bz2
PR ld/12942
bfd/ * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section rather than kept_section to determine whether a symbol is from a discarded section. * cofflink.c (coff_link_add_symbols): Make symbols from discarded sections appear undefined. * elf-bfd.h (_bfd_elf_section_already_linked): Replace "asection *" with "struct already_linked *". * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise. (_bfd_generic_section_already_linked): Likewise. (bfd_section_already_linked_table_insert): Likewise. (struct already_linked): New. (struct bfd_section_already_linked): Use it. * elflink.c (_bfd_elf_section_already_linked): Replace. "asection *" with "struct already_linked *". Replace the plugin dummy with the LTO output. * linker.c (_bfd_generic_section_already_linked): Likewise. * targets.c (struct already_linked): Add forward declaration. (bfd_target): Replace "struct bfd_section *" with "struct already_linked *" in _section_already_linked. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. include/ * bfdlink.h (bfd_link_info): Add loading_lto_outputs. ld/ * ldlang.c (section_already_linked): Pass "struct already_linked *" to bfd_section_already_linked. (lang_process): Set link_info.loading_lto_outputs before loading LTO outputs. * plugin.c: Include "libbfd.h". (add_symbols): Call bfd_section_already_linked with comdat_key.
Diffstat (limited to 'bfd/cofflink.c')
-rw-r--r--bfd/cofflink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index bca1364..27257ba 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -392,7 +392,11 @@ coff_link_add_symbols (bfd *abfd,
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
if (! obj_pe (abfd))
value -= section->vma;
- break;
+ /* Treat a symbol from a discarded section as undefined. */
+ if (bfd_is_abs_section (section)
+ || !bfd_is_abs_section (section->output_section))
+ break;
+ /* Fall thru */
case COFF_SYMBOL_UNDEFINED:
flags = 0;