aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
AgeCommit message (Collapse)AuthorFilesLines
2010-02-08 * section.c (struct bfd_section): Delete has_tls_reloc,Alan Modra1-0/+9
has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, reloc_done. Add sec_flg0 thru sec_flg5. (BFD_FAKE_SECTION): Update for changed flags. * ecoff.c (bfd_debug_section): Likewise. * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define. * elf64-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define. (has_toc_reloc, makes_toc_func_call, call_check_in_progress): Update. * elf32-xtensa.c (reloc_done): Define. * elfxx-ia64.c (skip_relax_pass_0, skip_relax_pass_1): Update. * bfd-in2.h: Regenerate.
2010-02-08bfd/Nathan Sidwell1-63/+32
* elf32-ppc.c (ppc_elf_begin_write_processing): Allow empty apuinfo sections, only scan input sections once and reuse the buffer. ld/testsuite/ * ld-powerpc/apuinfo-nul.s: New. * ld-powerpc/apuinfo.rd: Add it. * ld-powerpc/powerpc.exp: Likewise.
2010-02-08 * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.Alan Modra1-34/+25
2010-02-04 * elf-bfd.h (emum elf_object_id): Rename to elf_target_id. AddNick Clifton1-4/+6
entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-01-25 PR ld/11217Alan Modra1-1/+61
* elf64-ppc.c (ppc64_elf_tls_optimize): Optimize tls sequences with relocations against undefined weak symbols. (ppc64_elf_relocate_section): Don't optimize calls to undefined weak functions if the symbol is dynamic. (ppc64_elf_relocate_section): Edit tprel tls sequences. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. (_bfd_elf_ppc_at_tprel_transform): New function. * bfd-in.h (_bfd_elf_ppc_at_tprel_transform): Declare. * bfd-in2.h: Regenerate.
2009-12-17 PR ld/11088Alan Modra1-46/+66
include/elf/ * ppc.h (R_PPC_RELAX32, R_PPC_RELAX32PC, R_PPC_RELAX32_PLT, R_PPC_RELAX32PC_PLT): Delete. (R_PPC_RELAX, R_PPC_RELAX_PLT, R_PPC_RELAX_PLTREL24): Define. bfd/ * elf32-ppc.c (update_plt_info): Clear sec here when addend is less than 32768.. (ppc_elf_check_relocs): ..rather than doing so here. Ignore new relax relocs. (ppc_elf_gc_sweep_hook): Don't segfault when symbol hiding has removed plt_entry records. (ppc_elf_tls_setup): Handle PIE calls to __tls_get_addr correctly. (ppc_elf_tls_optimize): Likewise. Also dec __tls_get_addr refcount when optimizing code using new tlsgd and tlsld marker relocs. (ppc_elf_relax_section): Differentiate relaxed PLTREL24 relocs from ADDR24 relocs using plt or glink. Don't clear the addend for R_PPC_RELAX_PLTREL24. (ppc_elf_relocate_section): Correctly handle addends on relaxed PLTREL24 relocs.
2009-12-11Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton1-24/+31
Fix up all warnings generated by the addition of this switch.
2009-12-03 PR ld/11047Alan Modra1-7/+3
* elf32-ppc.c (ppc_elf_relocate_section): Delete __tls_get_addr symbol reference from relocs belonging to calls that are optimized away. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2009-11-18bfd/Alan Modra1-29/+44
* bfd-in.h (_bfd_elf_ppc_at_tls_transform): Declare. * bfd-in2.h: Regenerate. * elf64-ppc.c (ppc64_elf_relocate_section): Move code for R_PPC64_TLS insn optimisation to.. * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): ..here. New function. (ppc_elf_relocate_section): Use it. gas/ * config/tc-ppc.c (md_assemble): Report error on invalid @tls operands and opcode.
2009-09-21include/elf/Alan Modra1-10/+101
* ppc.h (DT_PPC_TLSOPT): Define. * ppc64.h (DT_PPC64_TLSOPT): Define. bfd/ * elf32-ppc.c (TLS_GET_ADDR_GLINK_SIZE): Define. (ADD_3_12_2, BEQLR, CMPWI_11_0, LWZ_11_3, LWZ_12_3): Define. (MR_0_3, MR_3_0): Define. (struct ppc_elf_link_hash_table): Add no_tls_get_addr_opt. (ppc_elf_select_plt_layout): Save emit_stub_syms param earlier. (ppc_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash table. Check for presense of __tls_get_addr_opt (allocate_dynrelocs): Increase glink entry size for __tls_get_addr. (ppc_elf_size_dynamic_sections): Add DT_PPC_TLS_OPT tag. (write_glink_stub): Add param p. (ppc_elf_relocate_section): Adjust write_glink_stub call. (ppc_elf_finish_dynamic_symbol): Emit special glink call stub for __tls_get_addr. * elf32-ppc.h (ppc_elf_tls_setup): Update prototype. * elf64-ppc.c (struct ppc_link_hash_table): Add no_tls_get_addr_opt. (ppc64_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash table. Check for presense of __tls_get_addr_opt. (ppc64_elf_size_dynamic_sections): Add DT_PPC64_TLS_OPT tag. (LD_R11_0R3, LD_R12_0R3, MR_R0_R3, CMPDI_R11_0, ADD_R3_R12_R13, BEQLR, MR_R3_R0, MFLR_R11, STD_R11_0R1, BCTRL, LD_R11_0R1, LD_R2_0R1, MTLR_R11): Define. (build_tls_get_addr_stub): New function. (ppc_build_one_stub): Call it. (ppc_size_one_stub): Add extra size for __tls_get_addr stub. (ppc64_elf_relocate_section): Don't change nop to ld 2,40(1) for __tls_get_addr plt call. * elf64-ppc.h (ppc64_elf_tls_setup): Update prototype. binutils/ * readelf.c (get_ppc_dynamic_type): Add TLSOPT. (get_ppc64_dynamic_type): Likewise. ld/ * emultempl/ppc32elf.em (no_tls_get_addr_opt): New var. (ppc_before_allocation): Pass to ppc_elf_tls_setup. (OPTION_NO_TLS_GET_ADDR_OPT): Define. Redefine other options in terms of previous option. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --no-tls-get-addr-optimize. (PARSE_AND_LIST_ARGS_CASES): Handle it. * emultempl/ppc64elf.em (no_tls_get_addr_opt): New var. (ppc_before_allocation): Pass to ppc64_elf_tls_setup. (OPTION_NO_TLS_GET_ADDR_OPT): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --no-tls-get-addr-optimize. (PARSE_AND_LIST_ARGS_CASES): Handle it. ld/testsuite/ * ld-powerpc/tlslib.s: Delete dot-symbol entry syms. Add __tls_get_addr_opt. * ld-powerpc/tlslib32.s: Add __tls_get_addr_opt. * ld-powerpc/oldtlslib.s: New file, old-abi version of tlslib.s. * ld-powerpc/powerpc.exp: Build old-abi library and use it in two new link tests. * ld-powerpc/tlsexe.d: Update for new __tls_get_addr stub. * ld-powerpc/tlsexe.g, * ld-powerpc/tlsexe.r, *ld-powerpc/tlsexe32.d, * ld-powerpc/tlsexe32.g, * ld-powerpc/tlsexe32.r, * ld-powerpc/tlsexetoc.d, * ld-powerpc/tlsexetoc.g, * ld-powerpc/tlsexetoc.r: Likewise.
2009-09-18 PR ld/10406Alan Modra1-29/+73
* elf32-ppc.c (ppc_elf_howto_raw): Make R_PPC_EMB_SDAI16 and R_PPC_EMB_SDA2I16 complain_overflow_signed. (create_sdata_sym): Pass info rather than htab. Update all callers. Ensure symbols are hidden. (ppc_elf_check_relocs): Allow SDAREL16 when shared. (ppc_elf_size_dynamic_sections): When shared, equate _SDA_BASE_ to _GLOBAL_OFFSET_TABLE_. (elf_finish_pointer_linker_section): Don't assume that sdata base symbol is always at 0x8000 offset. Don't subtract the addend here. (is_static_defined): New function. (ppc_elf_relocate_section): Verify symbol base used in SDA relocs is statically defined. Clear addend for EMB_SDAI16 and EMB_SDA2I16 relocs. Downgrade error on unexpected section for EMB_SDA2REL reloc symbols to a warning.
2009-08-10 bfd/Nathan Sidwell1-14/+22
* elf32-ppc.c (shared_stub_entry, stub_entry): Use r12, not r11. (ppc_elf_relax_section): Use symbol index to distinguish relocatable stubs. ld/testsuite/ * ld-powerpc/relax.s: New. * ld-powerpc/relax.d: New. * ld-powerpc/relaxr.d: New. * ld-powerpc/powerpc.exp: Add new tests.
2009-08-10 * elf32-ppc.c (ppc_elf_relax_section): Ignore non-code sections.Alan Modra1-1/+2
2009-08-10 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear pltAlan Modra1-14/+20
info for STT_GNU_IFUNC. * elf32-ppc.c (ppc_elf_check_relocs): Count a needed plt entry on got refs in case the symbol turns out to be ifunc. (ppc_elf_gc_sweep_hook): Similarly. (ppc_elf_adjust_dynamic_symbol): Adjust assertion. (allocate_dynrelocs): Don't specially allocate got relocs for ifunc. (ppc_elf_size_dynamic_sections): Likewise. (ppc_elf_relocate_section): Likewise.
2009-08-04 * elf32-ppc.c (ppc_elf_relax_section): Correct conditions underAlan Modra1-38/+41
which find_plt_ent is called. Delete redundant code.
2009-08-03 * elf32-ppc.c (struct plt_entry): Revise comments.Alan Modra1-22/+32
(ppc_elf_check_relocs): Don't create needless plt_entry info for non-pie executables. Don't test info->pie when info->shared already covers that case. (ppc_elf_gc_sweep_hook): Adjust for above change. (add_stub_sym): Don't test info->pie when info->shared tested. (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Likewise. (write_glink_stub, ppc_elf_finish_dynamic_symbol): Likewise. (ppc_elf_relax_section): Adjust find_plt_ent arguments. (ppc_elf_relocate_section): Likewise.
2009-08-03 * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref countAlan Modra1-112/+143
for local ifunc symbols in non-pie executables, regardless of reloc type. Don't specially create ifunc dyn relocs. Tidy ifunc code so that it's obvious that we only do anything special for local ifunc syms. (ppc_elf_gc_sweep_hook): Adjust to suit check_relocs changes. (allocate_dynrelocs): Correct comment for syms defined in plt. Don't specially allocate ifunc dyn relocs. (ppc_elf_relax_section): Relax branches to ifunc plt entries too. (ppc_elf_relocate_section): Set "relocation" value for ifunc syms in non-pie executables. No specially allocated dyn relocs for ifunc to write. Allow for local sym on R_PPC_RELAX32_PLT. (ppc_elf_finish_dynamic_symbol): Set value of ifunc symbols in a non-pie executable.
2009-07-29 * elf32-ppc.c (ppc_elf_check_relocs): Always set up sectionsAlan Modra1-67/+141
used by indirect function support. Count dynamic relocs for ifunc syms. (ppc_elf_adjust_dynamic_symbol): Tweak for ifunc. (allocate_dynrelocs): Allocate all non-dynamic ifunc plt entries in iplt and their relocs in reliplt. Don't make ifunc syms dynamic. Allocate got entry relocs for non-dynamic ifunc in reliplt. Handle other dynamic relocs for ifunc. (ppc_elf_size_dynamic_sections): Alloc dyn relocs for static ifunc in reliplt, likewise relocs for got against local ifunc. Typo fix on reliplt size adjust. (ppc_elf_relocate_section): Don't use plt scheme of allocating relocs 1-1 with entries for iplt, instead just add using reloc_count. Write got relocs and dyn relocs for ifunc to reliplt. Error on invalid ifunc dyn relocs. (ppc_elf_finish_dynamic_symbol): Adjust for non-dynamic ifunc plt in iplt/reliplt. * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_JMP_IREL, R_PPC64_REL16, R_PPC64_REL16_LO, R_PPC64_REL16_HI, R_PPC64_REL16_HA. (ppc64_elf_reloc_type_lookup): Handle new relocs. (ppc64_elf_check_relocs): Likewise. Count dyn relocs for ifunc. (allocate_dynrelocs): As for elf32-ppc.c above. (ppc64_elf_size_dynamic_sections): Likewise. (ppc_build_one_stub): Put non-dynamic ifunc plt call stubs in iplt, and their relocs in reliplt. Use R_PPC64_JMP_IREL. (ppc_size_one_stub): Similarly. (ppc64_elf_relocate_section): As for elf32-ppc.c above. Handle new relocs too. (ppc64_elf_finish_dynamic_symbol): As for elf32-ppc.c above.
2009-07-10STT_GNU_IFUNC support for PowerPC.Alan Modra1-170/+478
2009-06-22include/elf/Alan Modra1-0/+4
* ppc.h (R_PPC_RELAX*): Define as enum. bfd/ * elf32-ppc.c (ppc_elf_check_relocs): Handle R_PPC_RELAX* in switch. * elf32-v850.c (v850_elf_relocate_section): Warning fix.
2009-06-19 * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols forAlan Modra1-1/+6
R_PPC_PLTREL24 relocs. (ppc_elf_relocate_section): Likewise.
2009-06-19 * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather thanAlan Modra1-16/+18
pointer to sym hash. Update all uses. (update_plt_info): Likewise. Don't check addend here.
2009-06-18 * elf-bfd.h (struct sym_sec_cache): Delete.Alan Modra1-8/+17
(struct sym_cache): New. (bfd_section_from_r_symndx): Delete prototype. (bfd_sym_from_r_symndx): Define prototype. * elf.c (bfd_section_from_r_symndx): Delete, replace with.. (bfd_sym_from_r_symndx): ..new function. * elf32-arm.c: Update all uses of struct sym_sec_cache and bfd_section_from_r_symndx to new struct and function. * elf32-bfin.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68hc1x.h: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-sparc.h: Likewise.
2009-06-172009-06-17 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-6/+3
* elf32-arm.c (create_got_section): Get existing .rela.got section. * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise. * elf32-lm32.c (create_got_section): Likewise. * elf32-m32r.c (create_got_section): Likewise. * elf32-ppc.c (ppc_elf_create_got): Likewise. * elf32-s390.c (create_got_section): Likewise. * elf32-sh.c (create_got_section): Likewise. * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise. * elf64-s390.c (create_got_section): Likewise. * elfxx-sparc.c (create_got_section): Likewise. * elflink.c (_bfd_elf_create_got_section): Properly initialize the GOT size.
2009-05-27 bfd/Nathan Sidwell1-2/+40
* elf32-ppc.c (ppc_elf_relax_section): Work with a partial link. * bout.c (b_out_bfd_relax_section): Reject relocatable links. * elf32-m10300.c (mn10300_elf_relax_section): Likewise. * elf32-avr.c (elf32_avr_relax_section): Likewise. * elf32-frv.c (elf32_avr_relax_section): Likewise. * elf32-xtensa.c (elf_xtensa_relax_section): Likewise. * elf64-mmix.c (mmix_elf_relax_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise. * reloc.c (bfd_generic_relax_section): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. * vms.c (vms_bfd_relax_section): Likewise. ld/ * ldmain.c (main): Don't reject --relax -r. * ld.texinfo (PowerPC ELF32): Document behaviour of relaxing partial links. ld/testsuite/ * ld-powerpc/vxworks-relax-2.s: New. * ld-powerpc/vxworks-relax-2.rd: New. * ld-powerpc/powerpc.exp: Add it.
2009-03-21 * elf32-ppc.c (is_pic_glink_stub): Delete.Alan Modra1-21/+10
(is_nonpic_glink_stub): New function. (ppc_elf_get_synthetic_symtab): Check for last non-pic stub rather than first pic one. (struct ppc_elf_link_hash_table <glink_pltresolve>): Comment fix.
2009-03-04include/elf/Alan Modra1-23/+169
* ppc.h (R_PPC_TLSGD, R_PPC_TLSLD): Add new relocs. * ppc64.h (R_PPC64_TLSGD, R_PPC64_TLSLD): Add new relocs. bfd/ * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New. * section.c (struct bfd_section): Add has_tls_get_addr_call. (BFD_FAKE_SECTION): Init new flag. * ecoff.c (bfd_debug_section): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD. (ppc_elf_reloc_type_lookup): Handle new relocs. (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD. (ppc64_elf_reloc_type_lookup): Handle new relocs. (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. Set toc_ref for new relocs as appropriate. (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. gas/ * config/tc-ppc.c (ppc_elf_suffix): Error if ppc32 tls got relocs have non-zero addend. (md_assemble): Parse args of __tls_get_addr calls. (md_apply_fix): Handle BFD_RELOC_PPC_TLSGD and BFD_RELOC_PPC_TLSLD. ld/testsuite/ * ld-powerpc/tlsmark.s, * ld-powerpc/tlsmark.d: New test. * ld-powerpc/tlsmark32.s, * ld-powerpc/tlsmark32.d: New test. * ld-powerpc/powerpc.exp: Run them.
2009-02-15 * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,Alan Modra1-35/+47
add toc.symndx and toc.add. (ppc64_elf_check_relocs): Don't set htab->tls_get_addr here. Set up toc.add. (get_tls_mask): Add toc_addend param, set from toc.add. Adjust all callers. (ppc64_elf_tls_setup): Set htab->tls_get_addr and tls_get_addr_fd. (branch_reloc_hash_match): New function, extracted from.. (ppc64_elf_tls_optimize): ..here. (ppc64_elf_relocate_section): Properly set addends when optimizing tls sequences. Avoid unnecessary reading and writing of insns. Only redo reloc when symbol changed. Bypass symbol checks when using tlsld_got. * elf32-ppc.c (ppc_elf_tls_setup): Correct comment. (branch_reloc_hash_match): New function, extracted from.. (ppc_elf_tls_optimize): ..here. (ppc_elf_relocate_section): Avoid unnecessary reading of insns. Don't clear addend on zapped __tls_get_addr reloc.
2009-01-26 * ld-powerpc/powerpc.exp: Add vxworks relax testcase.Nathan Sidwell1-8/+39
* ld-powerpc/vxworks-relax.s, ld-powerpc/vxworks-relax.rd: New. * ld-powerpc/vxworks1.ld: Add .pad and .far input sections. * ld-powerpc/vxworks1.rd: Correct regexp for undefined symbols.
2008-11-25 * elflink.c (is_reloc_section): New function. Returns true if theNick Clifton1-44/+8
given name matches the name of the reloc-containing section associated with the given section. (get_dynamic_reloc_section_name): New function. Computes the name of the section that contains the dynamic relocs associated with the given section. (_bfd_elf_get_dynamic_reloc_section): New function. Returns a pointer to the section containing the dynamic relocs associated with the given section. (_bfd_elf_make_dynamic_reloc_section): New function. Creates a section to contain the dynamic relocs associated with a given section. * elf-bfd.h: Prototype the new functions. * elf-m10300.c (mn10300_elf_check_relocs): Use new functions. (mn10300_elf_final_link_relocs): Likewise. * elf32-arm.c (reloc_section_p): Delete - replaced by new functions. (elf32_arm_final_link_relocate): Use new functions. (elf32_arm_check_relocs): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. (elf_cris_check_relocs): Likewise. * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_check_relocs): Likewise. (i370_elf_relocate_section): Likewise. * elf32-i386.c (elf_i386_check_relocs): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. (m32r_elf_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_check_relocs): Likewise. * elf32_ppc.c (ppc_elf_check_relocs): Likewise. (ppc_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_check_relocs): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. (sh_elf_check_relocs): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. (elf_vax_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. * elf32-bfin.c (bfin_check_relocs): Remove redundant local variable 'sreloc'. (bfin_relocate_section): Likewise. * elf32-v850.c (v850_elf_check_relocs): Likewise.
2008-11-20 * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got forAlan Modra1-39/+43
TLS_LD even when symbol is used with other TLS reloc types. (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got. Leave addend zero on LD DTPMOD dynamic reloc.
2008-10-10include/elf/Nathan Froyd1-0/+27
* ppc.h: Add Tag_GNU_Power_ABI_Struct_Return. bfd/ * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge Tag_GNU_Power_ABI_Struct_Return. binutils/ * readelf.c (display_power_gnu_attribute): Decode Tag_GNU_Power_ABI_Struct_Return. ld/testsuite/ * ld-powerpc/gnu-attr-12-1.s: New file. * ld-powerpc/gnu-attr-12-2.s: New file. * ld-powerpc/gnu-attr-12-11.d: New file. * ld-powerpc/gnu-attr-12-21.d: New file. * ld-powerpc/powerpc.exp: Run new dump tests.
2008-09-19 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Handle vxworksAlan Modra1-10/+19
_GLOBAL_OFFSET_TABLE_ in .got.plt section. Add BFD_ASSERTs.
2008-09-16 PR 6844Alan Modra1-62/+48
* elf32-ppc.c (SYM_VAL): Define. Use throughout to find symbol vma. (ppc_elf_relocate_section): Correct GOT offset calculation. (ppc_elf_finish_dynamic_symbol): Use PPC_HA and PPC_LO. (ppc_elf_finish_dynamic_sections): Likewise. Error if htab->elf.hgot symbol is not defined in htab->got section.
2008-09-15 PR 6888Alan Modra1-11/+30
* elf32-ppc.c (ppc_elf_relocate_section): Handle NULL symbol section on R_PPC_TOC16, R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA, R_PPC_SECTOFF* relocs.
2008-08-12 * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs whenAlan Modra1-2/+4
!dynamic_sections_created. Don't make symbols with got references dynamic if !dynamic_sections_created. * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic relocs on undefined symbols. (ppc64_elf_relocate_section): Allow dynamic relocs on undefined symbols.
2008-08-06 * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.Alan Modra1-2/+3
(ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
2008-07-26Support PowerPC single-precision float.Alan Modra1-2/+14
2008-07-02 * elf32-ppc.c (is_pic_glink_stub): New function.Alan Modra1-2/+35
(ppc_elf_get_synthetic_symtab): Don't generate symbols when multiple shared/pie stubs per plt entry.
2008-06-30bfd/Richard Sandiford1-2/+3
* syms.c (BSF_SYNTHETIC): New flag. * elf.c (_bfd_elf_get_synthetic_symtab): Set it. * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise. * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour for synthetic symbols. * bfd-in2.h: Regenerate. opcodes/ * mips-dis.c (_print_insn_mips): Use bfd_asymbol_flavour to check for ELF symbols.
2008-05-14 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.Ulrich Weigand1-2/+2
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
2008-05-14 * elf32-ppc.c (section_covers_vma): New function.Alan Modra1-0/+205
(ppc_elf_get_synthetic_symtab): New function. (bfd_elf32_get_synthetic_symtab): Define. * elf64-ppc.c (section_covers_vma): New function. (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch table entries, and __glink_PLTresolve on resolver stub. (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
2008-05-12 PR 6443Alan Modra1-25/+49
* elf32-ppc.c (MUST_BE_DYN_RELOC): Delete. (must_be_dyn_reloc): New function. (ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs in pies. (ppc_elf_tls_optimize): Optimise pies. (ppc_elf_relocate_section): Use a section symbol rather than no symbol if possible for LD->IE TLS sequence, but don't error if we must use no symbol. * elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c. (must_be_dyn_reloc): Likewise. (ppc64_elf_check_relocs): Likewise. (ppc64_elf_tls_optimize): Likewise. (ppc64_elf_relocate_section): Likewise.
2008-03-25 bfd/Nathan Sidwell1-1/+28
* elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs in vxworks tls_vars sections. (allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise. * elf32-i386.c (allocate_dynrelocs, elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise. * elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections, ppc_elf_relocate_section): Likewise. * elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections, sh_elf_relocate_section): Likewise. * elfxx-sparc.c (allocate_dynrelocs, _bfd_sparc_elf_size_dynamic_sections, _bfd_sparc_elf_relocate_section): Likewise. ld/testsuite/ * ld-vxworks/tls-3.s: New. * ld-vxworks/tls-3.d: New.
2008-03-02 * elf32-ppc.c (allocate_dynrelocs): Discard relocs onAlan Modra1-9/+21
undefined symbols with internal or hidden visibility. (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL rather than SYMBOL_REFERENCES_LOCAL on branches. Don't return immediately on dynamic reloc error.
2008-03-01bfd/Alan Modra1-1/+23
* elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs if emitrelocations. (get_relocs): New function, split out from.. (ppc_build_one_stub): ..here. Add relocs on plt_branch stubs if emitrelocations. Remove indx temp. (ppc_size_one_stub): Count new stub relocs. (ppc64_elf_size_stubs): Count new glink reloc. (ppc64_elf_build_stubs): Emit glink reloc if emitrelocations. (ppc64_elf_finish_dynamic_sections): Output glink relocs. * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Describe non-pic glink code. ld/testsuite/ * ld-powerpc/relbrlt.d: Update. Also check .branch_lt section.
2008-02-26 * elf32-ppc.c (ppc_elf_check_relocs): Set pointer_equality_neededgdb_6_8-branchpointAlan Modra1-75/+92
for R_PPC_REL32 syms. Don't set non_got_ref on branch reloc syms, and assume branch relocs are not dynamic when non-shared. (readonly_dynrelocs): New function, split out from.. (maybe_set_textrel): ..here, renamed from old readonly_dynrelocs. (ppc_elf_adjust_dynamic_symbol): For symbols generating plt entries, clear non_got_ref.. (allocate_dynrelocs): ..and don't set u.def for undefined weak. Do allow dynamic relocs on undefined symbols. (ppc_elf_adjust_dynamic_symbol): Use readonly_dynrelocs. (ppc_elf_relocate_section): Mirror dynamic reloc changes in check_relocs. (ppc_elf_finish_dynamic_symbol): Don't give a warning on weak plt symbols needing pointer_equality_needed.
2008-02-23 * elf32-ppc.c (ppc_elf_check_relocs): Revert non_got_ref change.Alan Modra1-0/+3
2008-02-23 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): CopyAlan Modra1-17/+56
pointer_equality_needed. (ppc_elf_check_relocs): Split out non-branch relocs from others that might emit dynamic relocs. Set pointer_equality_needed for their symbols. Don't set non_got_ref on branch reloc symbols. (ppc_elf_hash_symbol): New function. (elf_backend_hash_symbol): Define. (ppc_elf_finish_dynamic_symbol): Handle pointer_equality_needed. Error if pointer_equality_needed on weak plt symbol.
2008-02-20PR 868Nick Clifton1-1/+1
* libbfd.c (bfd_realloc_or_free): New function. Performs like bfd_realloc, but if the (re)allocation fails, the pointer is freed. * libbfd-in.h: Prototype. * libbfd.h: Regenerate. * bfdio.c (bfd_bwrite): Use the new function. (bfd_seek): Likewise. * bfdwin.c:(bfd_get_file_window): Likewise. * elf-strtab.c (_bfd_elf_strtab_add): Likewise. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf32-xtensa.c (vsprintf_msg): Likewise. * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise. * stabs.c (_bfd_link_seciton_stabs): Likewise. * vms-misc.c (_bfd_vms_get_record): Likewise. * vms-tir.c (check_section): Likewise. * vms.c (vms_new_section_hook): Likewise. * elf32-arm.c (elf32_arm_section_map_add): Check that the allocation of sec_data->map succeeded before using it. * elflink.c (elf_link_output_sym): Do not overwrite finfo-> symshndxbuf until it is known that the reallocation succeeded.