aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
AgeCommit message (Collapse)AuthorFilesLines
1997-06-16Mon Jun 16 18:56:27 1997 Geoff Keating <geoffk@ozemail.com.au>Ian Lance Taylor1-152/+369
* elf32-ppc.c (ppc_elf_relocate_section): Don't emit R_PPC_REL* relocs in shared libraries which refer to local symbols. Cope with addend when processing a GOT relocation. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Only create symbols for sections that the linker didn't create. (ppc_elf_finish_dynamic_sections): Only try to write out a section symbol if it was created in ppc_elf_size_dynamic_sections. (ppc_elf_relocate_section): Complain if we have to generate a reloc relative to a section for which we didn't output a symbol. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Clean up. PLT relocs are 'rela' relocs, like everything else. .rela.plt is not a read-only section, so we don't have to special-case it. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Entries in the .rela.bss section are (of course) 'rela' relocs not 'rel' relocs. * elf32-ppc.c (ppc_elf_check_relocs): Initialise srelgot. (ppc_elf_relocate_section): @got offsets are 4 from start of the actual .got section. * elflink.c (_bfd_elf_create_got_section): The three reserved words start from the symbol '_GLOBAL_OFFSET_TABLE_'. * elf32-ppc.c (ppc_elf_size_dynamic_sections): '.rela' is 5 characters, not 4. * elf32-ppc.c (ppc_elf_check_relocs): Use _bfd_elf_create_got_section to create the GOT rather than ppc_elf_create_linker_section. Create the '.rela.got' section ourselves. (ppc_elf_finish_dynamic_symbol): Set up GOT relocations when a symbol has a GOT entry. (ppc_elf_relocate_section): Record when a symbol is used through the GOT, and allocate space in the GOT for each such symbol. (ppc_elf_adjust_dynamic_symbol): Delete unused .got.plt stuff. (ppc_elf_create_linker_section): Delete unused LINKER_SECTION_GOT stuff. * elf32-ppc.c (ppc_elf_howto_raw): GOT16_HA relocs should be treated in a similar way to ADDR16_HA relocs. (ppc_elf_relocate_section): PLTREL24 relocs do not get copied into shared objects; the linker must deal with them. (ppc_elf_create_linker_section): Stop setting _GLOBAL_OFFSET_TABLE_ to the wrong value; delete unused LINKER_SECTION_PLT stuff. (ppc_elf_check_relocs): Delete unused LINKER_SECTION_PLT stuff. (ppc_elf_finish_dynamic_sections): Use BFD calls to get GOT section, not ELF-specific calls. (elf_backend_plt_not_loaded): Set to 1. (elf_backend_got_symbol_offset): Set to 4. * elf-bfd.h (elf_backend_data): Add 'plt_not_loaded' member for when ld.so fills in the PLT; and 'got_symbol_offset' member. * elflink.c (_bfd_elf_create_dynamic_sections): Apply plt_not_loaded member. (_bfd_elf_create_got_section): Apply got_symbol_offset. * elfxx-target.h (elf_backend_plt_not_loaded): Set default to 'loaded'. (elf_backend_G_O_T_offset): Set default to 0. (elfNN_bed): Set added fields. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Was setting DT_RELENT in shared objects; should be DT_RELAENT. * elf32-ppc.c (ppc_elf_relocate_section): Propagate R_PPC_ADDR16_HA relocs to shared objects. Cope with case where such a reloc (in a non-shared object) refers to a symbol that's not defined.
1997-04-02Undo part of 3/26 change and always create got sectionMichael Meissner1-16/+39
1997-03-25 * stabs.c (_bfd_stab_section_offset): New function.Ian Lance Taylor1-9/+33
* libbfd-in.h (_bfd_stab_section_offset): Declare. * libbfd.h: Rebuild. * elf32-i386.c (elf_i386_relocate_section): Adjust the offset of a stab reloc. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mips.c (mips_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
1997-01-27 * elf32-i386.c (elf_i386_size_dynamic_sections): When checking forIan Lance Taylor1-2/+6
relocations against the text segment, look up the output name of the reloc section. * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
1997-01-03Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>Ian Lance Taylor1-2/+4
elf64-alpha multiple .got rewrite: * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry. (bfd_elf*_mkobject): Don't define here ... * elfxx-target.h: ... but rather here. Default always_size_sections hook to NULL. * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was what the #defines in elf-bfd.h transmuted it to anyway. * section.c: Add SEC_LINKER_CREATED flag. * bfd-in2.h: Rebuild. * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to relocation section flags. (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to recognize generated bits. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections): Likewise. * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections, mips_elf_create_compact_rel_section, mips_elf_create_got_section, mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_create_linker_section, ppc_elf_size_dynamic_sections): Likewise. * elf32-sparc.c (elf32_sparc_check_relocs, elf32_sparc_size_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to section flags. (_bfd_elf_create_dynamic_sections): Likewise. (_bfd_elf_make_linker_section_rela): Likewise. * elflink.h (elf_link_create_dynamic_sections): Likewise. (bfd_elf,size_dynamic_sections): Call the always_size_sections hook. (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to identify generated bits. (elf_link_input_bfd): Likewise. * elf64-alpha.c: Rewrite everything touching relocations.
1996-12-12Support R_PPC_PLTREL24Michael Meissner1-27/+217
1996-07-08 * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, useIan Lance Taylor1-2/+42
ppc_elf_addr16_ha_reloc. (ppc_elf_addr16_ha_reloc): New static function. PR 10036.
1996-05-24Do not put small common symbols into .sbss if ld -rMichael Meissner1-1/+3
1996-04-26Forward relocs to output if -BsharedMichael Meissner1-38/+78
1996-04-25Add support for linking against shared librariesMichael Meissner1-67/+326
1996-01-30 * elf32-hppa.c (elf32_hppa_relocate_section): Handle indirect andIan Lance Taylor1-10/+13
warning symbols correctly. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mips.c (mips_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
1996-01-25Make eabi error messages include symbol name if it is an external symbolMichael Meissner1-8/+17
1996-01-25Add more eabi relocationsMichael Meissner1-22/+47
1996-01-25Fix typo in eabl relocationsMichael Meissner1-8/+48
1996-01-23Implement R_PPC_EMB_{SDA21,RELSDA} relocationsMichael Meissner1-2/+11
1996-01-23Do not complain if some objects have the embedded bit set and others do not.Michael Meissner1-19/+5
1996-01-22Make 64k .sdata and .sdata2 sections work; fix typosMichael Meissner1-58/+20
1996-01-22Fix typo in last changeMichael Meissner1-4/+4
1996-01-22snapshot of eabi relocation support.Michael Meissner1-368/+318
1996-01-15Add new PPC relocationsMichael Meissner1-3/+109
1996-01-15Redo unknown reloc support. Do not allow symbols in .sdata/.sbss to satify ↵Michael Meissner1-122/+67
a TOC16 relocation. Begin support R_PPC_SDA{2,}REL relocation.
1996-01-13Warn about relocations we do not yet supportMichael Meissner1-11/+138
1996-01-12Add PowerPC support for SHF_EXCLUDE, SHT_ORDEREDMichael Meissner1-0/+18
1996-01-11update copyrightMichael Meissner1-1/+1
1996-01-11Add support for SHT_ORDERED and SHF_EXCLUDEMichael Meissner1-0/+33
1996-01-11 * elf-bfd.h (struct bfd_elf_section_data): Add tdata field.Ian Lance Taylor1-6/+6
(struct elf_obj_tdata): Rename ppc_flags_init field to flags_init. (elf_flags_init): Rename from elf_ppc_flags_init. * elf32-ppc.c (ppc_elf_set_private_flags): Use elf_flags_init, not elf_ppc_flags_init. (ppc_elf_copy_private_bfd_data): Likewise. (ppc_elf_merge_private_bfd_data): Likewise.
1996-01-04Make @GOT relocations workMichael Meissner1-236/+147
1995-12-21Work in progress to add real GOT supportMichael Meissner1-509/+1461
1995-09-25 * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handlerIan Lance Taylor1-34/+34
rather than a direct fprintf. * archive.c (_bfd_write_archive_contents): Likewise. * coffcode.h (coff_slurp_symbol_table): Likewise. * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise. (ppc_elf_unsupported_reloc): Likewise. (ppc_elf_relocate_section): Likewise. * i386linux.c (linux_tally_symbols): Likewise. (linux_finish_dynamic_link): Likewise. * osf-core.c (osf_core_core_file_p): Likewise. * rs6000-core.c (rs6000coff_get_section_contents): Likewise. * som.c (som_sizeof_headers): Likewise. * srec.c (srec_bad_byte): Likewise. * bfd.c (bfd_assert): Likewise. Also change file to be const. * libbfd-in.h (bfd_assert): Declare first parameter const. * libbfd.h: Rebuild. * coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning bfd_reloc_overflow is enough. * coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort. * coff-h8500.c (rtype2howto): Likewise. * coff-z8k.c (rtype2howto): Likewise. * coffcode.h (dummy_reloc16_extra_cases): Likewise. * elf.c (_bfd_elf_get_lineno): Likewise. (_bfd_elf_no_info_to_howto): Likewise. (_bfd_elf_no_info_to_howto_rel): Likewise. * hp300hpux.c (convert_sym_type): Likewise. (MY(swap_std_reloc_in)): Likewise. * elf.c (bfd_section_from_shdr): Remove #if 0 sections.
1995-09-25Fix previous changeMichael Meissner1-6/+6
1995-09-22Start work to all full PowerPC V.4 reloc support.Michael Meissner1-30/+58
1995-09-22minor cleanupMichael Meissner1-1/+1
1995-09-22minor cleanupMichael Meissner1-2/+0
1995-09-22Add support -mrelocatable-libMichael Meissner1-24/+36
1995-07-06Added new files elflink.c, elflink.h, elfcore.h.Ken Raeburn1-86/+560
Moved some mostly size-independent stuff from elfcode.h to elf.c, adding a data structure to elfcode.h with some misc data and callback functions. Added a pointer to that structure to the target back end data. More work can be done here. Renamed generic elf routines (not cpu-specific stuff) to start with bfd_elf or _bfd_elf. Updated most call sites, sometimes defined some macros. Moved some dynamic linking support code from m68k, sparc, i386 to common files, using target back end flags to control behavior. More work can probably be done here too. Moved core- and linker-support code out of elfcode.h to elf.c, elfcore.h, elflink.h, or elflink.c. Now elfcode.h contains only .o and executable support, plus #includes of elfcore.h and elflink.h. Much of the contents of these other header files can probably still be moved from the .h files to the .c files, to get compiled only once. Cleaned up some "gcc -Wall" warnings regarding unused or uninitialized variables, in generic and cpu-specific code.
1995-02-15Fix powerpc PC relative reloc & add some 16 bit relocs.Michael Meissner1-0/+926