From 470b21acfe92ce461251ebdb54c39cc821884461 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 8 Oct 2002 09:51:09 +0000 Subject: [PATCH] * elf64-ppc.c (edit_opd): Correct test for discarded sections. --- bfd/ChangeLog | 43 ++++++++++++++++++++++++------------------- bfd/elf64-ppc.c | 19 ++++++++++++------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4328d502a2..5746f81034 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,11 @@ +2002-10-08 Alan Modra + + * elf64-ppc.c (edit_opd): Correct test for discarded sections. + 2002-10-07 Mark Elbrecht - * cofflink.c (mark_relocs): Don't mark relocations in excluded sections. + * cofflink.c (mark_relocs): Don't mark relocations in excluded + sections. 2002-10-07 Alan Modra @@ -30,7 +35,7 @@ to correctly adjust got.refcount and plt.refcount. (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across. (sh_elf_check_relocs): Increment gotplt_refcount. - + 2002-10-01 Jakub Jelinek * elf32-i386.c (elf_i386_relocate_section): Fix @@ -49,10 +54,10 @@ R_X86_64_DTPOFF32 to st_value + addend in non-code sections. 2002-09-30 Gavin Romig-Koch - Ken Raeburn - Aldy Hernandez - Eric Christopher - Richard Sandiford + Ken Raeburn + Aldy Hernandez + Eric Christopher + Richard Sandiford * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New. (bfd_mach_mips5500): New. @@ -254,7 +259,7 @@ * elfcode.h (elf_slurp_reloc_table_from_section): Check for overflow. -2002-09-17 Stan Cox +2002-09-17 Stan Cox * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3. (mips_elf64_final_gp): Don't make up gp value. @@ -336,7 +341,7 @@ 2002-09-10 Michael Snyder * irix-core.c (do_sections, do_sections64): New functions. - (irix_core_core_file_p): Call new functions do_sections, + (irix_core_core_file_p): Call new functions do_sections, do_sections64, depending on corefile (32-bit or 64-bit). 2002-09-09 Richard Henderson @@ -346,8 +351,8 @@ 2002-09-04 Kevin Buettner - * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default - vector. + * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default + vector. 2002-09-02 Nick Clifton @@ -358,7 +363,7 @@ (v850_elf_relax_section): Replace caching of external symbols with caching of internal symbols obtained from calling bfd_elf_get_elf_syms(). - Fixup problems with freeing cached allocated memory blocks. + Fixup problems with freeing cached allocated memory blocks. 2002-09-02 Alan Modra @@ -527,7 +532,7 @@ * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT value if .init is an SHmedia function. Similarly for DT_FINI. * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise. - + 2002-08-23 Stephen Clarke * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize @@ -537,7 +542,7 @@ 2002-08-22 Kaz Kojima * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple - byte read when reading the return address register column. + byte read when reading the return address register column. 2002-08-22 Nick Clifton @@ -603,9 +608,9 @@ argument declaration. 2002-08-19 Elena Zannoni - - * archures.c (bfd_mach_ppc_e500): Added. - * bfd-in2.h: Rebuilt. + + * archures.c (bfd_mach_ppc_e500): Added. + * bfd-in2.h: Rebuilt. * cpu-powerpc.c (bfd_powerpc_archs): Added e500. 2002-08-19 Alan Modra @@ -615,7 +620,7 @@ 2002-08-17 Andrew Cagney * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to - `bfd_byte'. + `bfd_byte'. 2002-08-17 Stan Cox @@ -627,7 +632,7 @@ * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect symbols when looking for section referred to by a relocation. * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. - + 2002-08-15 Alan Modra * elf32-i370.c: Move reloc enum to include/elf/i370.h. @@ -716,7 +721,7 @@ 2002-08-09 Graeme Peterson - * Makefile.am: Add entries for elf32-ppcqnx.c, and add + * Makefile.am: Add entries for elf32-ppcqnx.c, and add elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c. * Makefile.in: Regenerate. * config.bfd: Add support for powerpc{le}-*-nto targets. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index bf2a6d795f..37b30e6278 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3675,12 +3675,16 @@ edit_opd (obfd, info) break; } - if (sym_sec->output_section == bfd_abs_section_ptr) - { - /* OK, we've found a function that's excluded from the - link. */ - need_edit = true; - } + /* opd entries are always for functions defined in the + current input bfd. If the symbol isn't defined in the + input bfd, then we won't be using the function in this + bfd; It must be defined in a linkonce section in another + bfd, or is weak. It's also possible that we are + discarding the function due to a linker script /DISCARD/, + which we test for via the output_section. */ + if (sym_sec->owner != ibfd + || sym_sec->output_section == bfd_abs_section_ptr) + need_edit = true; offset += 24; } @@ -3754,7 +3758,8 @@ edit_opd (obfd, info) sym->st_shndx); } - skip = sym_sec->output_section == bfd_abs_section_ptr; + skip = (sym_sec->owner != ibfd + || sym_sec->output_section == bfd_abs_section_ptr); if (skip) { if (h != NULL) -- 2.11.0