summaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement generic SHF_EXCLUDE.H.J. Lu2010-05-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * elf.c (_bfd_elf_make_section_from_shdr): Handle SHF_EXCLUDE (elf_fake_sections): Likewise. * elf32-i370.c (i370_elf_section_from_shdr): Don't handle SHF_EXCLUDE here. * elf32-ppc.c (ppc_elf_fake_sections): Likewise. binutils/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * readelf.c (get_elf_section_flags): Treat SHF_EXCLUDE as a generic flag. binutils/testsuite/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * binutils-all/objcopy.exp: Run exclude-1a and exclude-1b for ELF targets. * binutils-all/exclude-1.s: New. * binutils-all/exclude-1a.d: Likewise. * binutils-all/exclude-1b.d: Likewise. gas/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * obj-elf.c (obj_elf_change_section): Handle SHF_EXCLUDE. (obj_elf_parse_section_letters): Likewise. (obj_elf_section_word): Likewise. * config/tc-ppc.c (ppc_section_letter): Removed. (ppc_section_word): Likewise. * config/tc-ppc.h (ppc_section_letter): Likewise. (ppc_section_word): Likewise. (md_elf_section_letter): Likewise. (md_elf_section_word): Likewise. * doc/as.texinfo: Document `e' and `#exclude'. gas/testsuite/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * gas/elf/elf.exp: Run section8. * gas/elf/section8.d: New. * gas/elf/section8.s: Likewise. include/elf/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * common.h (SHF_EXCLUDE): New. * i370.h (SHF_EXCLUDE): Removed. * or32.h (SHF_EXCLUDE): Likewise. * ppc.h (SHF_EXCLUDE): Likewise. * sparc.h (SHF_EXCLUDE): Likewise. ld/testsuite/ 2010-05-18 H.J. Lu <hongjiu.lu@intel.com> PR gas/11600 * ld-elf/exclude3.s: New. * ld-elf/exclude3a.d: Likewise. * ld-elf/exclude3b.d: Likewise. * ld-elf/exclude3c.d: Likewise.
* bfd/Nathan Sidwell2010-04-011-9/+10
| | | | | | | | | | | | | * elf32-ppc.c (apuinfo_set): New static var. (ppc_elf_begin_write_processing): Set it here, always create an APUinfo section if there were any in the inputs. (ppc_elf_write_section): Check apuinfo_set. (ppc_elf_final_write_processing): Likewise. ld/testsuite/ * ld-powerpc/apuinfo-nul.rd: New. * ld-powerpc/apuinfo-nul1.s: New. * ld-powerpc/powerpc.exp: Add it.
* * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_EMB_RELSDA>): Not pc-relative.Alan Modra2010-03-261-1/+1
| | | | | | * bfd-in.h (elf_discarded_section): Clarify comment. * reloc.c (struct reloc_howto_struct <pc_relative>): Likewise. * bfd-in2.h: Regenerate.
* Don't set ELFOSABI_LINUX in dynamic ifunc-using executable.H.J. Lu2010-02-191-1/+2
| | | | | | | | | | | | | | | | | | | | | bfd/ 2010-02-18 H.J. Lu <hongjiu.lu@intel.com> * elf32-i386.c (elf_i386_add_symbol_hook): Don't set has_ifunc_symbols if the symbol comes from a shared library. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise. ld/testsuite/ 2010-02-18 H.J. Lu <hongjiu.lu@intel.com> * ld-ifunc/ifunc.exp: Expect System V OSABI in dynamic ifunc-using executable.
* * section.c (struct bfd_section): Delete has_tls_reloc,Alan Modra2010-02-081-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.
* bfd/Nathan Sidwell2010-02-081-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.
* * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.Alan Modra2010-02-081-34/+25
|
* * elf-bfd.h (emum elf_object_id): Rename to elf_target_id. AddNick Clifton2010-02-041-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.
* PR ld/11217Alan Modra2010-01-251-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.
* PR ld/11088Alan Modra2009-12-171-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.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-24/+31
| | | | Fix up all warnings generated by the addition of this switch.
* PR ld/11047Alan Modra2009-12-031-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.
* bfd/Alan Modra2009-11-181-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.
* include/elf/Alan Modra2009-09-211-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.
* PR ld/10406Alan Modra2009-09-181-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.
* bfd/Nathan Sidwell2009-08-101-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.
* * elf32-ppc.c (ppc_elf_relax_section): Ignore non-code sections.Alan Modra2009-08-101-1/+2
|
* * elflink.c (_bfd_elf_adjust_dynamic_symbol): Don't clear pltAlan Modra2009-08-101-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.
* * elf32-ppc.c (ppc_elf_relax_section): Correct conditions underAlan Modra2009-08-041-38/+41
| | | | which find_plt_ent is called. Delete redundant code.
* * elf32-ppc.c (struct plt_entry): Revise comments.Alan Modra2009-08-031-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.
* * elf32-ppc.c (ppc_elf_check_relocs): Always add a plt ref countAlan Modra2009-08-031-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.
* * elf32-ppc.c (ppc_elf_check_relocs): Always set up sectionsAlan Modra2009-07-291-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.
* STT_GNU_IFUNC support for PowerPC.Alan Modra2009-07-101-170/+478
|
* include/elf/Alan Modra2009-06-221-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.
* * elf32-ppc.c (ppc_elf_check_relocs): Allow local symbols forAlan Modra2009-06-191-1/+6
| | | | | R_PPC_PLTREL24 relocs. (ppc_elf_relocate_section): Likewise.
* * elf32-ppc.c (find_plt_ent): Pass pointer to plist rather thanAlan Modra2009-06-191-16/+18
| | | | | pointer to sym hash. Update all uses. (update_plt_info): Likewise. Don't check addend here.
* * elf-bfd.h (struct sym_sec_cache): Delete.Alan Modra2009-06-181-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-17 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-06-171-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.
* bfd/Nathan Sidwell2009-05-271-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.
* * elf32-ppc.c (is_pic_glink_stub): Delete.Alan Modra2009-03-211-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.
* include/elf/Alan Modra2009-03-041-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.
* * elf64-ppc.c (struct _ppc64_elf_section_data): Delete t_symndx,Alan Modra2009-02-151-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.
* * ld-powerpc/powerpc.exp: Add vxworks relax testcase.Nathan Sidwell2009-01-261-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.
* * elflink.c (is_reloc_section): New function. Returns true if theNick Clifton2008-11-251-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.
* * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got forAlan Modra2008-11-201-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.
* include/elf/Nathan Froyd2008-10-101-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.
* * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Handle vxworksAlan Modra2008-09-191-10/+19
| | | | _GLOBAL_OFFSET_TABLE_ in .got.plt section. Add BFD_ASSERTs.
* PR 6844Alan Modra2008-09-161-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.
* PR 6888Alan Modra2008-09-151-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.
* * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs whenAlan Modra2008-08-121-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.
* * elf32-ppc.c (ppc_elf_relax_section): Clear R_PPC_PLTREL24 addend.Alan Modra2008-08-061-2/+3
| | | | (ppc_elf_relocate_section <R_PPC_RELAX32_PLT>): Don't bother here.
* Support PowerPC single-precision float.Alan Modra2008-07-261-2/+14
|
* * elf32-ppc.c (is_pic_glink_stub): New function.Alan Modra2008-07-021-2/+35
| | | | | (ppc_elf_get_synthetic_symtab): Don't generate symbols when multiple shared/pie stubs per plt entry.
* bfd/Richard Sandiford2008-06-301-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.
* * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.Ulrich Weigand2008-05-141-2/+2
| | | | * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
* * elf32-ppc.c (section_covers_vma): New function.Alan Modra2008-05-141-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.
* PR 6443Alan Modra2008-05-121-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.
* bfd/Nathan Sidwell2008-03-251-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.
* * elf32-ppc.c (allocate_dynrelocs): Discard relocs onAlan Modra2008-03-021-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.
* bfd/sid-snapshot-20080301Alan Modra2008-03-011-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.