64-bit PowerPC ELF patch
Linus Nordberg
linus@swox.com
Tue Dec 14 07:23:00 GMT 1999
Here is a patch for 64-bit PPC ELF. It's against a snapshot from
Cygnus CVS of today (1999-12-14).
ChangeLog:
1999-12-14 Linus Nordberg <linus@swox.se>
* configure.in (powerpc-*-elf64): New target.
bfd/ChangeLog:
1999-12-14 Linus Nordberg <linus@swox.se>
* targets.c (bfd_target_vector): Add bfd_elf64_powerpc_vec,
bfd_elf64_powerpcle_vec.
* Makefile.am (BFD64_BACKENDS_CFILES): Add elf64-ppc.c.
(BFD64_BACKENDS): Add elf64-ppc.lo.
(elf64-ppc.lo): Add target.
* configure.in (bfd_elf64_powerpc_vec, bfd_elf64_powerpcle_vec):
New vectors.
* config.bfd (powerpc-*-*elf64): New target.
* elf64-ppc.c: New file.
* elfxx-target.h (elf_backend_plt_has_contents): Define.
(elf_backend_want_got_sym): Define.
(elfNN_bed): Add elf_backend_plt_has_contents and
elf_backend_want_got_sym.
* elf-bfd.h (elf_backend_data): Add plt_has_contents and
want_got_sym.
* elflink.c (_bfd_elf_create_dynamic_sections): Set SEC_CODE flag
for .plt section only if bed->plt_has_contents is true.
(_bfd_elf_create_got_section): Define _GLOBAL_OFFSET_TABLE_ only
if bed->want_got_sym.
* reloc.c: Add 64-bit PPC relocs.
Incorporated from Cygnus CVS:
* elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
field.
gas/ChangeLog:
1999-12-14 Torbjorn Granlund <tege@swox.com>
* config/tc-ppc.c (md_apply_fix3): For OBJ_ELF, don't put addend
in instruction field. Put the ELF64 specific relocs within #ifdef
TARGET_ABI_PPC_ELF64. Replace haphazard code for determining
reloc type with code reading operands->reloc field. Always check
the we have a symbol before recording a reloc. Check
ppc_is_toc_sym for operands that want BFD_RELOC_PPC_TOC16
1999-12-14 Linus Nordberg <linus@swox.se>
* config/tc-ppc.c: Add macros for calculating ``high'', ``high
adjusted'' and such.
(SHLIB_MRELOCATABLE): Fix typo (was SHILB_MRELOCATABLE).
(ppc_aixelf_info_no_stabx): New function.
(ppc_aixelf_csect): New function. Switch to .data for all but
`.text[*]', `*[PR]' and sections without braces. Set BSF_FUNCTION
flag for `.SYM'.
(ppc_aixelf_lglobl): New function.
(ppc_aixelf_rename): New function.
(ppc_aixelf_toc): New function.
(ppc_aixelf_vbyte): New function.
(ppc_aixelf_stabx): New function.
(ppc_machine): New function.
(md_pseudo_table): Use them.
(ppc_aixelf_frob_symbol): New function.
(lack_stabx_warn_done): New static variable to keep info about
whether we have warned user about lacking STABX support.
(ppc_aixelf_stabx): Use it.
(ppc_aixelf_info_no_stabx): Likewise.
(ppc_is_toc_sym): Check for section ``.toc'' instead of ``.got''
if 64-bit. Test TARGET_ABI_PPC_ELF64, not ppc_size for choosing
elf64* or elf32*.
(saix): Static variable indicating that we're reading AIX assembly
syntax.
(md_shortopts): Add `-S'.
(md_parse_option): Handle `-Saix'. Set default size to 32.
(md_show_usage): Ditto.
(ppc_elf_suffix): Add @higher[a], @highest[a], @tocbase, @toc.
(md_apply_fix3): Handle BFD_RELOC_PPC64_HIGHER with friends.
Handle BFD_RELOC_64 and BFD_RELOC_64_PCREL. BFD_RELOC_HI16* now
use the PPC_HI/HA macros. Parenthesize to avoid compiler warning.
Don't require operand->insert == NULL to generate TOC16.
(ppc_tc): If we're 64-bit, align to eight byte boundary and
allocate 8 bytes. Test TARGET_ABI_PPC_ELF64, not ppc_size for
choosing elf64* or elf32*.
(ppc_elf_cons): Handle `TOC[tc0]' if aix syntax.
(ppc_elf_target_format): New function.
(ppc_elf_lcomm): Ignore third argument if AIX syntax.
(md_begin): Override ppc_size here if TARGET_ABI_PPC_ELF64.
(ppc_canonicalize_symbol_name): Use for OBJ_ELF as well.
(ppc_symbol_new_hook): Likewise.
(md_assemble): Don't complain over large addend for new HIGH types
(HIGHER, HIGHER_S, HIGHEST, HIGHEST_S).
* config/tc-ppc.h: Include config.h. Handle AIX style symbol
class suffixes in ELF mode.
(TARGET_FORMAT): Set to ppc_elf_target_format().
(TARGET_ABI_PPC_ELF64): Define if not already defined (by
config.h).
(tc_canonicalize_symbol_name): Define.
(tc_symbol_new_hook): Ditto.
(tc_frob_symbol): Ditto.
(TC_SYMFIELD_TYPE): Ditto.
(LEX_BR): Ditto.
(ppc_tc_sy): New struct.
(ELF_TC_SPECIAL_SECTIONS): Define for 64-bit PPC ELF.
* configure.in: New target ppc-*-elf64.
(ppc-*-elf64): Define TARGET_ABI_PPC_ELF64.
* configure: Regenerate.
* config.in: Ditto.
Incorporated from Cygnus CVS:
* config/obj-ecoff.c (obj_ecoff_set_ext): Change uses of bsym to
use symbol_get_bfdsym instead.
* config/tc-ppc.c (md_assemble): Likewise.
include/elf/ChangeLog:
1999-12-14 Linus Nordberg <linus@swox.com>
* ppc.h: Add 64-bit PPC relocs.
ld/ChangeLog:
1999-12-14 Linus Nordberg <linus@swox.se>
* Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o.
(eelf64ppc.c, eelf64lppc.c): Add make targets.
* Makefile.in: Regenerate.
* configure.tgt: (powerpc-*-elf64, powerpcle-*-elf64): New
targets.
* emulparams/elf64ppc.sh: New file.
* emulparams/elf64lppc.sh: New file.
* scripttempl/elf64ppc.sc: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FSF-19991214+SWOX-19991213.diff.gz
Type: application/x-gzip
Size: 46974 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/19991214/4477f3e4/attachment.bin>
More information about the Binutils
mailing list