diff options
author | Jeff Law <law@redhat.com> | 1994-05-16 19:34:13 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1994-05-16 19:34:13 +0000 |
commit | 459ae909b9afdda03da2255929ba1ec14a233ce9 (patch) | |
tree | 41584161b10f3244c3ba54a21a17a5c2e1b8f19f /bfd | |
parent | 3315c7c71422bde8222cadbb9c1eb0568304c7d0 (diff) | |
download | gdb-459ae909b9afdda03da2255929ba1ec14a233ce9.zip gdb-459ae909b9afdda03da2255929ba1ec14a233ce9.tar.gz gdb-459ae909b9afdda03da2255929ba1ec14a233ce9.tar.bz2 |
* bfd-in2.h: Rebuilt.
* elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
likewise for other PA specific sections.
(hppa_elf_relocate_unwind_table): Delete unused
function.
(elf_hppa_howto_table): Completely new table based on 94-02-02
draft PA ELF spec. Change relocation tags appropriately
throughout elf32-hppa.c
(hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
spec.
(hppa_elf_reloc): Likewise.
(hppa_look_for_stubs_in_section): Likewise
(ELF_MACHINE_CODE): Change to EM_PARISC.
* elf32-hppa.h: Include "elf/hppa.h". Change relocation tags
appropriately throughout elf32-hppa.h.
(elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
spec.
(R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
* elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
* reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
* som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
* libhppa.h (hppa_field_adjust): Avoid adding constant_value into
the final value twice for LR and RR field selectors.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 23 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 97 | ||||
-rw-r--r-- | bfd/elf32-hppa.c | 1323 | ||||
-rw-r--r-- | bfd/elf32-hppa.h | 344 | ||||
-rw-r--r-- | bfd/elfcode.h | 14 | ||||
-rw-r--r-- | bfd/som.h | 56 |
6 files changed, 552 insertions, 1305 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 97f3419..571c597 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,28 @@ Mon May 16 10:09:22 1994 Jeff Law (law@snake.cs.utah.edu) + * bfd-in2.h: Rebuilt. + + * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs, + likewise for other PA specific sections. + (hppa_elf_relocate_unwind_table): Delete unused + function. + (elf_hppa_howto_table): Completely new table based on 94-02-02 + draft PA ELF spec. Change relocation tags appropriately + throughout elf32-hppa.c + (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02 + spec. + (hppa_elf_reloc): Likewise. + (hppa_look_for_stubs_in_section): Likewise + (ELF_MACHINE_CODE): Change to EM_PARISC. + * elf32-hppa.h: Include "elf/hppa.h". Change relocation tags + appropriately throughout elf32-hppa.h. + (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF + spec. + (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions. + * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA. + * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations. + * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions. + * libhppa.h (hppa_field_adjust): Avoid adding constant_value into the final value twice for LR and RR field selectors. diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 6ea2e08..89fb1bf 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1377,103 +1377,6 @@ typedef enum bfd_reloc_code_real BFD_RELOC_MIPS_CALL16, #define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL32 - /* These are, so far, specific to HPPA processors. I'm not sure that some - don't duplicate other reloc types, such as BFD_RELOC_32 and _32_PCREL. - Also, many more were in the list I got that don't fit in well in the - model BFD uses, so I've omitted them for now. If we do make this reloc - type get used for code that really does implement the funky reloc types, - they'll have to be added to this list. */ - BFD_RELOC_HPPA_32, - BFD_RELOC_HPPA_11, - BFD_RELOC_HPPA_14, - BFD_RELOC_HPPA_17, - - BFD_RELOC_HPPA_L21, - BFD_RELOC_HPPA_R11, - BFD_RELOC_HPPA_R14, - BFD_RELOC_HPPA_R17, - BFD_RELOC_HPPA_LS21, - BFD_RELOC_HPPA_RS11, - BFD_RELOC_HPPA_RS14, - BFD_RELOC_HPPA_RS17, - BFD_RELOC_HPPA_LD21, - BFD_RELOC_HPPA_RD11, - BFD_RELOC_HPPA_RD14, - BFD_RELOC_HPPA_RD17, - BFD_RELOC_HPPA_LR21, - BFD_RELOC_HPPA_RR14, - BFD_RELOC_HPPA_RR17, - - BFD_RELOC_HPPA_GOTOFF_11, - BFD_RELOC_HPPA_GOTOFF_14, - BFD_RELOC_HPPA_GOTOFF_L21, - BFD_RELOC_HPPA_GOTOFF_R11, - BFD_RELOC_HPPA_GOTOFF_R14, - BFD_RELOC_HPPA_GOTOFF_LS21, - BFD_RELOC_HPPA_GOTOFF_RS11, - BFD_RELOC_HPPA_GOTOFF_RS14, - BFD_RELOC_HPPA_GOTOFF_LD21, - BFD_RELOC_HPPA_GOTOFF_RD11, - BFD_RELOC_HPPA_GOTOFF_RD14, - BFD_RELOC_HPPA_GOTOFF_LR21, - BFD_RELOC_HPPA_GOTOFF_RR14, - - BFD_RELOC_HPPA_DLT_32, - BFD_RELOC_HPPA_DLT_11, - BFD_RELOC_HPPA_DLT_14, - BFD_RELOC_HPPA_DLT_L21, - BFD_RELOC_HPPA_DLT_R11, - BFD_RELOC_HPPA_DLT_R14, - - BFD_RELOC_HPPA_ABS_CALL_11, - BFD_RELOC_HPPA_ABS_CALL_14, - BFD_RELOC_HPPA_ABS_CALL_17, - BFD_RELOC_HPPA_ABS_CALL_L21, - BFD_RELOC_HPPA_ABS_CALL_R11, - BFD_RELOC_HPPA_ABS_CALL_R14, - BFD_RELOC_HPPA_ABS_CALL_R17, - BFD_RELOC_HPPA_ABS_CALL_LS21, - BFD_RELOC_HPPA_ABS_CALL_RS11, - BFD_RELOC_HPPA_ABS_CALL_RS14, - BFD_RELOC_HPPA_ABS_CALL_RS17, - BFD_RELOC_HPPA_ABS_CALL_LD21, - BFD_RELOC_HPPA_ABS_CALL_RD11, - BFD_RELOC_HPPA_ABS_CALL_RD14, - BFD_RELOC_HPPA_ABS_CALL_RD17, - BFD_RELOC_HPPA_ABS_CALL_LR21, - BFD_RELOC_HPPA_ABS_CALL_RR14, - BFD_RELOC_HPPA_ABS_CALL_RR17, - - BFD_RELOC_HPPA_PCREL_CALL_11, - BFD_RELOC_HPPA_PCREL_CALL_12, - BFD_RELOC_HPPA_PCREL_CALL_14, - BFD_RELOC_HPPA_PCREL_CALL_17, - BFD_RELOC_HPPA_PCREL_CALL_L21, - BFD_RELOC_HPPA_PCREL_CALL_R11, - BFD_RELOC_HPPA_PCREL_CALL_R14, - BFD_RELOC_HPPA_PCREL_CALL_R17, - BFD_RELOC_HPPA_PCREL_CALL_LS21, - BFD_RELOC_HPPA_PCREL_CALL_RS11, - BFD_RELOC_HPPA_PCREL_CALL_RS14, - BFD_RELOC_HPPA_PCREL_CALL_RS17, - BFD_RELOC_HPPA_PCREL_CALL_LD21, - BFD_RELOC_HPPA_PCREL_CALL_RD11, - BFD_RELOC_HPPA_PCREL_CALL_RD14, - BFD_RELOC_HPPA_PCREL_CALL_RD17, - BFD_RELOC_HPPA_PCREL_CALL_LR21, - BFD_RELOC_HPPA_PCREL_CALL_RR14, - BFD_RELOC_HPPA_PCREL_CALL_RR17, - - BFD_RELOC_HPPA_PLABEL_32, - BFD_RELOC_HPPA_PLABEL_11, - BFD_RELOC_HPPA_PLABEL_14, - BFD_RELOC_HPPA_PLABEL_L21, - BFD_RELOC_HPPA_PLABEL_R11, - BFD_RELOC_HPPA_PLABEL_R14, - - BFD_RELOC_HPPA_UNWIND_ENTRY, - BFD_RELOC_HPPA_UNWIND_ENTRIES, - /* i386/elf relocations */ BFD_RELOC_386_GOT32, BFD_RELOC_386_PLT32, diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 7a0f37d..407971f 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -200,10 +200,6 @@ static unsigned long hppa_elf_relocate_insn PARAMS ((bfd *, asection *, unsigned long, unsigned long, long, long, unsigned long, unsigned long, unsigned long)); -static void hppa_elf_relocate_unwind_table - PARAMS ((bfd *, PTR, unsigned long, long, long, - unsigned long, unsigned long)); - static long get_symbol_value PARAMS ((asymbol *)); static bfd_reloc_status_type hppa_elf_reloc @@ -269,145 +265,192 @@ static boolean elf32_hppa_backend_fake_sections static boolean elf32_hppa_backend_section_from_bfd_section PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *)); +static void elf32_hppa_backend_begin_write_processing PARAMS ((bfd *)); + +static void elf32_hppa_backend_final_write_processing PARAMS ((bfd *)); + +static void add_entry_to_symext_chain + PARAMS ((bfd *, elf_symbol_type *, int, symext_chainS **, symext_chainS **)); + +static void +elf_hppa_tc_make_sections PARAMS ((bfd *, symext_chainS *)); + static boolean hppa_elf_is_local_label PARAMS ((bfd *, asymbol *)); /* ELF/PA relocation howto entries. */ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = { - {R_HPPA_NONE, 0, 3, 19, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_NONE"}, - {R_HPPA_32, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_32"}, - {R_HPPA_11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_11"}, - {R_HPPA_14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_14"}, - {R_HPPA_17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_17"}, -{R_HPPA_L21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_L21"}, -{R_HPPA_R11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_R11"}, -{R_HPPA_R14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_R14"}, -{R_HPPA_R17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_R17"}, - {R_HPPA_LS21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_LS21"}, - {R_HPPA_RS11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RS11"}, - {R_HPPA_RS14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RS14"}, - {R_HPPA_RS17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RS17"}, - {R_HPPA_LD21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_LD21"}, - {R_HPPA_RD11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RD11"}, - {R_HPPA_RD14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RD14"}, - {R_HPPA_RD17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RD17"}, - {R_HPPA_LR21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_LR21"}, - {R_HPPA_RR14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RR14"}, - {R_HPPA_RR17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_RR17"}, - {R_HPPA_GOTOFF_11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_11"}, - {R_HPPA_GOTOFF_14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_14"}, - {R_HPPA_GOTOFF_L21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_L21"}, - {R_HPPA_GOTOFF_R11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_R11"}, - {R_HPPA_GOTOFF_R14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_R14"}, - {R_HPPA_GOTOFF_LS21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_LS21"}, - {R_HPPA_GOTOFF_RS11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_RS11"}, - {R_HPPA_GOTOFF_RS14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_RS14"}, - {R_HPPA_GOTOFF_LD21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_LD21"}, - {R_HPPA_GOTOFF_RD11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_RD11"}, - {R_HPPA_GOTOFF_RD14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_RD14"}, - {R_HPPA_GOTOFF_LR21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_LR21"}, - {R_HPPA_GOTOFF_RR14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_GOTOFF_RR14"}, - {R_HPPA_ABS_CALL_11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_11"}, - {R_HPPA_ABS_CALL_14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_14"}, - {R_HPPA_ABS_CALL_17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_17"}, - {R_HPPA_ABS_CALL_L21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_L21"}, - {R_HPPA_ABS_CALL_R11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_R11"}, - {R_HPPA_ABS_CALL_R14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_R14"}, - {R_HPPA_ABS_CALL_R17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_R17"}, - {R_HPPA_ABS_CALL_LS21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_LS21"}, - {R_HPPA_ABS_CALL_RS11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RS11"}, - {R_HPPA_ABS_CALL_RS14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RS14"}, - {R_HPPA_ABS_CALL_RS17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RS17"}, - {R_HPPA_ABS_CALL_LD21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_LD21"}, - {R_HPPA_ABS_CALL_RD11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RD11"}, - {R_HPPA_ABS_CALL_RD14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RD14"}, - {R_HPPA_ABS_CALL_RD17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RD17"}, - {R_HPPA_ABS_CALL_LR21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_LR21"}, - {R_HPPA_ABS_CALL_RR14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RR14"}, - {R_HPPA_ABS_CALL_RR17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ABS_CALL_RR17"}, - {R_HPPA_PCREL_CALL_11, 0, 3, 11, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_11"}, - {R_HPPA_PCREL_CALL_14, 0, 3, 14, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_14"}, - {R_HPPA_PCREL_CALL_17, 0, 3, 17, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_17"}, - {R_HPPA_PCREL_CALL_12, 0, 3, 12, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_12"}, - {R_HPPA_PCREL_CALL_L21, 0, 3, 21, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_L21"}, - {R_HPPA_PCREL_CALL_R11, 0, 3, 11, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_R11"}, - {R_HPPA_PCREL_CALL_R14, 0, 3, 14, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_R14"}, - {R_HPPA_PCREL_CALL_R17, 0, 3, 17, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_R17"}, - {R_HPPA_PCREL_CALL_LS21, 0, 3, 21, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_LS21"}, - {R_HPPA_PCREL_CALL_RS11, 0, 3, 11, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RS11"}, - {R_HPPA_PCREL_CALL_RS14, 0, 3, 14, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RS14"}, - {R_HPPA_PCREL_CALL_RS17, 0, 3, 17, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RS17"}, - {R_HPPA_PCREL_CALL_LD21, 0, 3, 21, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_LD21"}, - {R_HPPA_PCREL_CALL_RD11, 0, 3, 11, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RD11"}, - {R_HPPA_PCREL_CALL_RD14, 0, 3, 14, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RD14"}, - {R_HPPA_PCREL_CALL_RD17, 0, 3, 17, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RD17"}, - {R_HPPA_PCREL_CALL_LR21, 0, 3, 21, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_LR21"}, - {R_HPPA_PCREL_CALL_RR14, 0, 3, 14, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RR14"}, - {R_HPPA_PCREL_CALL_RR17, 0, 3, 17, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PCREL_CALL_RR17"}, - {R_HPPA_PLABEL_32, 0, 3, 32, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_32"}, - {R_HPPA_PLABEL_11, 0, 3, 11, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_11"}, - {R_HPPA_PLABEL_14, 0, 3, 14, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_14"}, - {R_HPPA_PLABEL_L21, 0, 3, 21, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_L21"}, - {R_HPPA_PLABEL_R11, 0, 3, 11, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_R11"}, - {R_HPPA_PLABEL_R14, 0, 3, 14, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_PLABEL_R14"}, - {R_HPPA_DLT_32, 0, 3, 32, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_32"}, - {R_HPPA_DLT_11, 0, 3, 11, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_11"}, - {R_HPPA_DLT_14, 0, 3, 14, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_14"}, - {R_HPPA_DLT_L21, 0, 3, 21, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_L21"}, - {R_HPPA_DLT_R11, 0, 3, 11, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_R11"}, - {R_HPPA_DLT_R14, 0, 3, 14, false, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_DLT_R14"}, - {R_HPPA_UNWIND_ENTRY, 0, 3, 32, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_UNWIND_ENTRY"}, - {R_HPPA_UNWIND_ENTRIES, 0, 3, 32, true, 0, complain_overflow_signed, hppa_elf_reloc, "R_HPPA_UNWIND_ENTRIES"}, - {R_HPPA_PUSH_CONST, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_CONST"}, - {R_HPPA_PUSH_PC, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_PC"}, - {R_HPPA_PUSH_SYM, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_SYM"}, - {R_HPPA_PUSH_GOTOFF, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_GOTOFF"}, - {R_HPPA_PUSH_ABS_CALL, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_ABS_CALL"}, - {R_HPPA_PUSH_PCREL_CALL, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_PCREL_CALL"}, - {R_HPPA_PUSH_PLABEL, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_PUSH_PLABEL"}, -{R_HPPA_MAX, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_MAX"}, -{R_HPPA_MIN, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_MIN"}, -{R_HPPA_ADD, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ADD"}, -{R_HPPA_SUB, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_SUB"}, - {R_HPPA_MULT, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_MULT"}, -{R_HPPA_DIV, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_DIV"}, -{R_HPPA_MOD, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_MOD"}, -{R_HPPA_AND, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_AND"}, - {R_HPPA_OR, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_OR"}, -{R_HPPA_XOR, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_XOR"}, -{R_HPPA_NOT, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_NOT"}, - {R_HPPA_LSHIFT, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_LSHIFT"}, - {R_HPPA_ARITH_RSHIFT, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_ARITH_RSHIFT"}, - {R_HPPA_LOGIC_RSHIFT, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_LOGIC_RSHIFT"}, -{R_HPPA_EXPR_F, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_L"}, - {R_HPPA_EXPR_L, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_L"}, - {R_HPPA_EXPR_R, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_R"}, - {R_HPPA_EXPR_LS, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_LS"}, - {R_HPPA_EXPR_RS, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_RS"}, - {R_HPPA_EXPR_LD, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_LD"}, - {R_HPPA_EXPR_RD, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_RD"}, - {R_HPPA_EXPR_LR, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_LR"}, - {R_HPPA_EXPR_RR, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_RR"}, - {R_HPPA_EXPR_32, 0, 3, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_32"}, - {R_HPPA_EXPR_21, 0, 3, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_21"}, - {R_HPPA_EXPR_11, 0, 3, 11, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_11"}, - {R_HPPA_EXPR_14, 0, 3, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_14"}, - {R_HPPA_EXPR_17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_17"}, - {R_HPPA_EXPR_12, 0, 3, 12, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_EXPR_12"}, - {R_HPPA_STUB_CALL_17, 0, 3, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_HPPA_STUB_CALL_17"}, - {R_HPPA_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_HPPA_UNIMPLEMENTED"}, + {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_NONE"}, + {R_PARISC_DIR32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR32"}, + {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR21L"}, + {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17R"}, + {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR17F"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DIR14R"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL21L"}, + {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17R"}, + {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17F"}, + {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL17C"}, + {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL14R"}, + {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PCREL14F"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL21L"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL14R"}, + {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DPREL14F"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL21L"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL14R"}, + {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTREL14F"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND21L"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND14R"}, + {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_DLTIND14F"}, + + {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_SETBASE"}, + {R_PARISC_BASEREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL32"}, + {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL21L"}, + {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL17R"}, + {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL17F"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL14R"}, + {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_BASEREL14F"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_TEXTREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_TEXTREL32"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_DATAREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL32"}, + {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL21L"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLABEL14R"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_PLTIND21L, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND21L"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_UNIMPLEMENTED"}, + {R_PARISC_PLTIND14R, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND14R"}, + {R_PARISC_PLTIND14F, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_PLTIND14F"}, + + + {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_COPY"}, + {R_PARISC_GLOB_DAT, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_GLOB_DAT"}, + {R_PARISC_JMP_SLOT, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_JMP_SLOT"}, + {R_PARISC_RELATIVE, 0, 0, 0, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_RELATIVE"}, + {R_PARISC_STUB_CALL_17, 0, 0, 17, false, 0, complain_overflow_bitfield, hppa_elf_reloc, "R_PARISC_STUB_CALL_17"}, + + {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, }; static symext_chainS *symext_rootP; static symext_chainS *symext_lastP; -static boolean symext_chain_built; +static int symext_chain_size; static long global_value; static long GOT_value; static asymbol *global_symbol; static int global_sym_defined; static symext_entryS *symextn_contents; -static unsigned int symextn_contents_real_size; static elf32_hppa_stub_description *elf_hppa_stub_rootP; static boolean stubs_finished = false; static struct elf32_hppa_symextn_map_struct *elf32_hppa_symextn_map; @@ -503,70 +546,6 @@ hppa_elf_relocate_insn (abfd, input_sect, insn, address, sym_value, } } -/* Relocate a single unwind entry, or an entire table of them. */ - -static void -hppa_elf_relocate_unwind_table (abfd, data, address, sym_value, - r_addend, r_type, r_field) - bfd *abfd; - PTR data; - unsigned long address; - long sym_value; - long r_addend; - unsigned long r_type; - unsigned long r_field; -{ - bfd_byte *hit_data = address + (bfd_byte *) data; - long start_offset; - long end_offset; - long relocated_value; - int i; - - switch (r_type) - { - case R_HPPA_UNWIND_ENTRY: - /* Need to relocate the first two 32bit fields in the unwind. They - correspond to a function's start and end address. */ - start_offset = bfd_get_32 (abfd, hit_data); - relocated_value = hppa_field_adjust (sym_value, start_offset, r_field); - bfd_put_32 (abfd, relocated_value, hit_data); - - hit_data += sizeof (unsigned long); - end_offset = bfd_get_32 (abfd, hit_data); - relocated_value = hppa_field_adjust (sym_value, end_offset, r_field); - bfd_put_32 (abfd, relocated_value, hit_data); - break; - - case R_HPPA_UNWIND_ENTRIES: - /* Relocate a mass of unwind entires. The count is passed in r_addend - (who's braindamaged idea was this anyway? */ - for (i = 0; i < r_addend; i++, hit_data += 3 * sizeof (unsigned long)) - { - unsigned int adjustment; - /* Adjust the first 32bit field in the unwind entry. It's - the starting offset of a function. */ - start_offset = bfd_get_32 (abfd, hit_data); - bfd_put_32 (abfd, sym_value, hit_data); - adjustment = sym_value - start_offset; - - /* Now adjust the second 32bit field, it's the ending offset - of a function. */ - hit_data += sizeof (unsigned long); - end_offset = adjustment + bfd_get_32 (abfd, hit_data); - bfd_put_32 (abfd, end_offset, hit_data); - - /* Prepare for the next iteration. */ - start_offset = bfd_get_32 (abfd, - hit_data + 3 * sizeof (unsigned long)); - sym_value = start_offset + adjustment; - } - break; - - default: - abort (); - } -} - /* Return the relocated value of the given symbol. */ static long @@ -620,65 +599,21 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) case R_HPPA: switch (format) { - case 11: - switch (field) - { - case e_fsel: - final_type = R_HPPA_11; - break; - case e_rsel: - final_type = R_HPPA_R11; - break; - case e_rssel: - final_type = R_HPPA_RS11; - break; - case e_rdsel: - final_type = R_HPPA_RD11; - break; - case e_psel: - final_type = R_HPPA_PLABEL_11; - break; - case e_rpsel: - final_type = R_HPPA_PLABEL_R11; - break; - case e_tsel: - final_type = R_HPPA_DLT_11; - break; - case e_rtsel: - final_type = R_HPPA_DLT_R11; - break; - default: - abort (); - break; - } - break; - case 14: switch (field) { case e_rsel: - final_type = R_HPPA_R14; - break; - case e_rssel: - final_type = R_HPPA_RS14; - break; - case e_rdsel: - final_type = R_HPPA_RD14; - break; case e_rrsel: - final_type = R_HPPA_RR14; - break; - case e_psel: - final_type = R_HPPA_PLABEL_14; + final_type = R_PARISC_DIR14R; break; - case e_rpsel: - final_type = R_HPPA_PLABEL_R14; + case e_rtsel: + final_type = R_PARISC_DLTREL14R; break; case e_tsel: - final_type = R_HPPA_DLT_14; + final_type = R_PARISC_DLTREL14F; break; - case e_rtsel: - final_type = R_HPPA_DLT_R14; + case e_rpsel: + final_type = R_PARISC_PLABEL14R; break; default: abort (); @@ -690,19 +625,11 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) switch (field) { case e_fsel: - final_type = R_HPPA_17; + final_type = R_PARISC_DIR17F; break; case e_rsel: - final_type = R_HPPA_R17; - break; - case e_rssel: - final_type = R_HPPA_RS17; - break; - case e_rdsel: - final_type = R_HPPA_RD17; - break; case e_rrsel: - final_type = R_HPPA_RR17; + final_type = R_PARISC_DIR17R; break; default: abort (); @@ -714,22 +641,14 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) switch (field) { case e_lsel: - final_type = R_HPPA_L21; - break; - case e_lssel: - final_type = R_HPPA_LS21; - break; - case e_ldsel: - final_type = R_HPPA_LD21; - break; case e_lrsel: - final_type = R_HPPA_LR21; - break; - case e_lpsel: - final_type = R_HPPA_PLABEL_L21; + final_type = R_PARISC_DIR21L; break; case e_ltsel: - final_type = R_HPPA_PLABEL_L21; + final_type = R_PARISC_DLTREL21L; + break; + case e_lpsel: + final_type = R_PARISC_PLABEL21L; break; default: abort (); @@ -741,13 +660,10 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) switch (field) { case e_fsel: - final_type = R_HPPA_32; + final_type = R_PARISC_DIR32; break; case e_psel: - final_type = R_HPPA_PLABEL_32; - break; - case e_tsel: - final_type = R_HPPA_DLT_32; + final_type = R_PARISC_PLABEL32; break; default: abort (); @@ -765,44 +681,15 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) case R_HPPA_GOTOFF: switch (format) { - case 11: - switch (field) - { - case e_rsel: - final_type = R_HPPA_GOTOFF_R11; - break; - case e_rssel: - final_type = R_HPPA_GOTOFF_RS11; - break; - case e_rdsel: - final_type = R_HPPA_GOTOFF_RD11; - break; - case e_fsel: - final_type = R_HPPA_GOTOFF_11; - break; - default: - abort (); - break; - } - break; - case 14: switch (field) { case e_rsel: - final_type = R_HPPA_GOTOFF_R14; - break; - case e_rssel: - final_type = R_HPPA_GOTOFF_RS14; - break; - case e_rdsel: - final_type = R_HPPA_GOTOFF_RD14; - break; case e_rrsel: - final_type = R_HPPA_GOTOFF_RR14; + final_type = R_PARISC_DPREL14R; break; case e_fsel: - final_type = R_HPPA_GOTOFF_14; + final_type = R_PARISC_DPREL14F; break; default: abort (); @@ -813,117 +700,9 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) case 21: switch (field) { - case e_lsel: - final_type = R_HPPA_GOTOFF_L21; - break; - case e_lssel: - final_type = R_HPPA_GOTOFF_LS21; - break; - case e_ldsel: - final_type = R_HPPA_GOTOFF_LD21; - break; case e_lrsel: - final_type = R_HPPA_GOTOFF_LR21; - break; - default: - abort (); - break; - } - break; - - default: - abort (); - break; - } - break; - - - case R_HPPA_PCREL_CALL: - switch (format) - { - case 11: - switch (field) - { - case e_rsel: - final_type = R_HPPA_PCREL_CALL_R11; - break; - case e_rssel: - final_type = R_HPPA_PCREL_CALL_RS11; - break; - case e_rdsel: - final_type = R_HPPA_PCREL_CALL_RD11; - break; - case e_fsel: - final_type = R_HPPA_PCREL_CALL_11; - break; - default: - abort (); - break; - } - break; - - case 14: - switch (field) - { - case e_rsel: - final_type = R_HPPA_PCREL_CALL_R14; - break; - case e_rssel: - final_type = R_HPPA_PCREL_CALL_RS14; - break; - case e_rdsel: - final_type = R_HPPA_PCREL_CALL_RD14; - break; - case e_rrsel: - final_type = R_HPPA_PCREL_CALL_RR14; - break; - case e_fsel: - final_type = R_HPPA_PCREL_CALL_14; - break; - default: - abort (); - break; - } - break; - - case 17: - switch (field) - { - case e_rsel: - final_type = R_HPPA_PCREL_CALL_R17; - break; - case e_rssel: - final_type = R_HPPA_PCREL_CALL_RS17; - break; - case e_rdsel: - final_type = R_HPPA_PCREL_CALL_RD17; - break; - case e_rrsel: - final_type = R_HPPA_PCREL_CALL_RR17; - break; - case e_fsel: - final_type = R_HPPA_PCREL_CALL_17; - break; - default: - abort (); - break; - } - break; - - case 21: - switch (field) - { case e_lsel: - final_type = R_HPPA_PCREL_CALL_L21; - break; - case e_lssel: - final_type = R_HPPA_PCREL_CALL_LS21; - break; - case e_ldsel: - final_type = R_HPPA_PCREL_CALL_LD21; - break; - case e_lrsel: - final_type = R_HPPA_PCREL_CALL_LR21; + final_type = R_PARISC_DPREL21L; break; default: abort (); @@ -938,110 +717,18 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) break; - case R_HPPA_PLABEL: - switch (format) - { - case 11: - switch (field) - { - case e_fsel: - final_type = R_HPPA_PLABEL_11; - break; - case e_rsel: - final_type = R_HPPA_PLABEL_R11; - break; - default: - abort (); - break; - } - break; - - case 14: - switch (field) - { - case e_fsel: - final_type = R_HPPA_PLABEL_14; - break; - case e_rsel: - final_type = R_HPPA_PLABEL_R14; - break; - default: - abort (); - break; - } - break; - - case 21: - switch (field) - { - case e_lsel: - final_type = R_HPPA_PLABEL_L21; - break; - default: - abort (); - break; - } - break; - - case 32: - switch (field) - { - case e_fsel: - final_type = R_HPPA_PLABEL_32; - break; - default: - abort (); - break; - } - break; - - default: - abort (); - break; - } - - - case R_HPPA_ABS_CALL: + case R_HPPA_PCREL_CALL: switch (format) { - case 11: - switch (field) - { - case e_rsel: - final_type = R_HPPA_ABS_CALL_R11; - break; - case e_rssel: - final_type = R_HPPA_ABS_CALL_RS11; - break; - case e_rdsel: - final_type = R_HPPA_ABS_CALL_RD11; - break; - case e_fsel: - final_type = R_HPPA_ABS_CALL_11; - break; - default: - abort (); - break; - } - break; - case 14: switch (field) { case e_rsel: - final_type = R_HPPA_ABS_CALL_R14; - break; - case e_rssel: - final_type = R_HPPA_ABS_CALL_RS14; - break; - case e_rdsel: - final_type = R_HPPA_ABS_CALL_RD14; - break; case e_rrsel: - final_type = R_HPPA_ABS_CALL_RR14; + final_type = R_PARISC_PCREL14R; break; case e_fsel: - final_type = R_HPPA_ABS_CALL_14; + final_type = R_PARISC_PCREL14F; break; default: abort (); @@ -1053,19 +740,11 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) switch (field) { case e_rsel: - final_type = R_HPPA_ABS_CALL_R17; - break; - case e_rssel: - final_type = R_HPPA_ABS_CALL_RS17; - break; - case e_rdsel: - final_type = R_HPPA_ABS_CALL_RD17; - break; case e_rrsel: - final_type = R_HPPA_ABS_CALL_RR17; + final_type = R_PARISC_PCREL17R; break; case e_fsel: - final_type = R_HPPA_ABS_CALL_17; + final_type = R_PARISC_PCREL17F; break; default: abort (); @@ -1077,16 +756,8 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) switch (field) { case e_lsel: - final_type = R_HPPA_ABS_CALL_L21; - break; - case e_lssel: - final_type = R_HPPA_ABS_CALL_LS21; - break; - case e_ldsel: - final_type = R_HPPA_ABS_CALL_LD21; - break; case e_lrsel: - final_type = R_HPPA_ABS_CALL_LR21; + final_type = R_PARISC_PCREL21L; break; default: abort (); @@ -1100,23 +771,8 @@ hppa_elf_gen_reloc_type (abfd, base_type, format, field) } break; - - case R_HPPA_UNWIND: - final_type = R_HPPA_UNWIND_ENTRY; - break; - - - case R_HPPA_COMPLEX: - case R_HPPA_COMPLEX_PCREL_CALL: - case R_HPPA_COMPLEX_ABS_CALL: - /* The code originally here was horribly broken, and apparently - never used. Zap it. When we need complex relocations rewrite - it correctly! */ - abort (); - break; - default: - final_type = base_type; + abort (); break; } @@ -1153,6 +809,12 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (output_bfd) { reloc_entry->address += input_section->output_offset; + + /* Work around lossage in generic elf code to write relocations. + (maps different section symbols into the same symbol index). */ + if ((symbol_in->flags & BSF_SECTION_SYM) + && symbol_in->section) + reloc_entry->addend += symbol_in->section->output_offset; return bfd_reloc_ok; } @@ -1186,218 +848,55 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* Get the instruction word. */ insn = bfd_get_32 (abfd, hit_data); - /* Relocate the value based on one of the basic relocation types - - basic_type_1: relocation is relative to $global$ - basic_type_2: relocation is relative to the current GOT - basic_type_3: relocation is an absolute call - basic_type_4: relocation is an PC-relative call - basic_type_5: relocation is plabel reference - basic_type_6: relocation is an unwind table relocation - extended_type: unimplemented */ - switch (r_type) { - case R_HPPA_NONE: + case R_PARISC_NONE: break; - /* Handle all the basic type 1 relocations. */ - case R_HPPA_32: - case R_HPPA_11: - case R_HPPA_14: - case R_HPPA_17: + case R_PARISC_DIR32: + case R_PARISC_DIR17F: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL17C: + case R_PARISC_PLABEL32: + case R_PARISC_PCREL14F: r_field = e_fsel; goto do_basic_type_1; - case R_HPPA_L21: - r_field = e_lsel; - goto do_basic_type_1; - case R_HPPA_R11: - case R_HPPA_R14: - case R_HPPA_R17: - r_field = e_rsel; - goto do_basic_type_1; - case R_HPPA_LS21: - r_field = e_lssel; - goto do_basic_type_1; - case R_HPPA_RS11: - case R_HPPA_RS14: - case R_HPPA_RS17: - r_field = e_ldsel; - goto do_basic_type_1; - case R_HPPA_LD21: - r_field = e_ldsel; - goto do_basic_type_1; - case R_HPPA_RD11: - case R_HPPA_RD14: - case R_HPPA_RD17: - r_field = e_rdsel; - goto do_basic_type_1; - case R_HPPA_LR21: + case R_PARISC_DIR21L: + case R_PARISC_PCREL21L: + case R_PARISC_PLABEL21L: r_field = e_lrsel; goto do_basic_type_1; - case R_HPPA_RR14: - case R_HPPA_RR17: + case R_PARISC_DIR17R: + case R_PARISC_PCREL17R: + case R_PARISC_DIR14R: + case R_PARISC_PCREL14R: + case R_PARISC_PLABEL14R: r_field = e_rrsel; + goto do_basic_type_1; - do_basic_type_1: - insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, - sym_value, r_addend, r_format, - r_field, r_pcrel); - break; - - /* Handle all the basic type 2 relocations. */ - case R_HPPA_GOTOFF_11: - case R_HPPA_GOTOFF_14: - r_field = e_fsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_L21: - r_field = e_lsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_R11: - case R_HPPA_GOTOFF_R14: - r_field = e_rsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_LS21: - r_field = e_lssel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_RS11: - case R_HPPA_GOTOFF_RS14: - r_field = e_rssel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_LD21: - r_field = e_ldsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_RD11: - case R_HPPA_GOTOFF_RD14: - r_field = e_rdsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_LR21: + case R_PARISC_DPREL21L: r_field = e_lrsel; - goto do_basic_type_2; - case R_HPPA_GOTOFF_RR14: - r_field = e_rrsel; - - do_basic_type_2: sym_value -= GOT_value; - insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, - sym_value, r_addend, r_format, - r_field, r_pcrel); - break; - - /* Handle all the basic type 3 relocations. */ - case R_HPPA_ABS_CALL_11: - case R_HPPA_ABS_CALL_14: - case R_HPPA_ABS_CALL_17: - r_field = e_fsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_L21: - r_field = e_lsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_R11: - case R_HPPA_ABS_CALL_R14: - case R_HPPA_ABS_CALL_R17: - r_field = e_rsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_LS21: - r_field = e_lssel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_RS11: - case R_HPPA_ABS_CALL_RS14: - case R_HPPA_ABS_CALL_RS17: - r_field = e_rssel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_LD21: - r_field = e_ldsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_RD11: - case R_HPPA_ABS_CALL_RD14: - case R_HPPA_ABS_CALL_RD17: - r_field = e_rdsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_LR21: - r_field = e_lrsel; - goto do_basic_type_3; - case R_HPPA_ABS_CALL_RR14: - case R_HPPA_ABS_CALL_RR17: + goto do_basic_type_1; + case R_PARISC_DPREL14R: r_field = e_rrsel; - - do_basic_type_3: - insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, - sym_value, r_addend, r_format, - r_field, r_pcrel); - break; - - /* Handle all the basic type 4 relocations. */ - case R_HPPA_PCREL_CALL_11: - case R_HPPA_PCREL_CALL_14: - case R_HPPA_PCREL_CALL_17: + sym_value -= GOT_value; + goto do_basic_type_1; + case R_PARISC_DPREL14F: r_field = e_fsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_L21: - r_field = e_lsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_R11: - case R_HPPA_PCREL_CALL_R14: - case R_HPPA_PCREL_CALL_R17: - r_field = e_rsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_LS21: - r_field = e_lssel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_RS11: - case R_HPPA_PCREL_CALL_RS14: - case R_HPPA_PCREL_CALL_RS17: - r_field = e_rssel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_LD21: - r_field = e_ldsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_RD11: - case R_HPPA_PCREL_CALL_RD14: - case R_HPPA_PCREL_CALL_RD17: - r_field = e_rdsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_LR21: - r_field = e_lrsel; - goto do_basic_type_4; - case R_HPPA_PCREL_CALL_RR14: - case R_HPPA_PCREL_CALL_RR17: - r_field = e_rrsel; + sym_value -= GOT_value; + goto do_basic_type_1; - do_basic_type_4: - insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, - sym_value, r_addend, r_format, - r_field, r_pcrel); - break; - /* Handle all the basic type 5 relocations. */ - case R_HPPA_PLABEL_32: - case R_HPPA_PLABEL_11: - case R_HPPA_PLABEL_14: - r_field = e_fsel; - goto do_basic_type_5; - case R_HPPA_PLABEL_L21: - r_field = e_lsel; - goto do_basic_type_5; - case R_HPPA_PLABEL_R11: - case R_HPPA_PLABEL_R14: - r_field = e_rsel; - do_basic_type_5: +do_basic_type_1: insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, sym_value, r_addend, r_format, r_field, r_pcrel); break; - /* Handle all basic type 6 relocations. */ - case R_HPPA_UNWIND_ENTRY: - case R_HPPA_UNWIND_ENTRIES: - hppa_elf_relocate_unwind_table (abfd, data, addr, - sym_value, r_addend, - r_type, r_field); - return bfd_reloc_ok; /* This is a linker internal relocation. */ - case R_HPPA_STUB_CALL_17: + case R_PARISC_STUB_CALL_17: /* This relocation is for a branch to a long branch stub. Change instruction to a BLE,N. It may also be necessary to interchange the branch and its delay slot. @@ -1435,7 +934,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, { insn = BLE_N_XXX_0_0; bfd_put_32 (abfd, insn, hit_data); - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, sym_value, r_addend, @@ -1467,7 +966,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, new_delay_slot_insn |= ((31 << 21) | (31 << 16)); bfd_put_32 (abfd, new_delay_slot_insn, hit_data + 4); insn = BLE_XXX_0_0; - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, sym_value, r_addend, @@ -1480,7 +979,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* The return register is r31, so this is a millicode call. Do not perform any instruction reordering. */ insn = BLE_XXX_0_0; - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, sym_value, @@ -1504,7 +1003,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, bfd_put_32 (abfd, insn, hit_data); insn = BLE_N_XXX_0_0; bfd_put_32 (abfd, insn, hit_data + 4); - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr + 4, @@ -1520,7 +1019,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* The return register is r31, so this is a millicode call. Perform no instruction reordering in this case. */ insn = BLE_XXX_0_0; - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr, sym_value, @@ -1544,7 +1043,7 @@ hppa_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, bfd_put_32 (abfd, insn, hit_data); insn = BLE_N_XXX_0_0; bfd_put_32 (abfd, insn, hit_data + 4); - r_type = R_HPPA_ABS_CALL_17; + r_type = R_PARISC_DIR17F; r_pcrel = 0; insn = hppa_elf_relocate_insn (abfd, input_section, insn, addr + 4, sym_value, @@ -1575,7 +1074,7 @@ elf_hppa_reloc_type_lookup (abfd, code) bfd *abfd; bfd_reloc_code_real_type code; { - if ((int) code < (int) R_HPPA_UNIMPLEMENTED) + if ((int) code < (int) R_PARISC_UNIMPLEMENTED) { BFD_ASSERT ((int) elf_hppa_howto_table[(int) code].type == (int) code); return &elf_hppa_howto_table[(int) code]; @@ -1593,30 +1092,119 @@ hppa_elf_is_local_label (abfd, sym) return (sym->name[0] == 'L' && sym->name[1] == '$'); } +/* Do any backend specific processing when beginning to write an object + file. For PA ELF we need to determine the size of the symbol extension + section *before* any other output processing happens. */ + +static void +elf32_hppa_backend_begin_write_processing (abfd) + bfd *abfd; +{ + int i; + asection *symextn_sec; + + /* Size up the symbol extension section. We can't built it just + yet as the elf_symbol_map hasn't been built. */ + if (abfd->outsymbols == NULL || symext_chain_size != 0) + return; + + /* Look at each symbol, and determine if it will need an entry in + the symbol extension section. */ + for (i = 0; i < abfd->symcount; i++) + { + elf_symbol_type *symbol = (elf_symbol_type *)abfd->outsymbols[i]; + + /* Only functions ever need an entry in the symbol extension + section. */ + if (!(symbol->symbol.flags & BSF_FUNCTION)) + continue; + + /* And only if they specify the locations of their arguments. */ + if (symbol->tc_data.hppa_arg_reloc == 0) + continue; + + /* Yup. This function symbol needs an entry. */ + symext_chain_size += 2 * sizeof (symext_entryS); + } + + /* Now create the section and set its size. We'll fill in the + contents later. */ + symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME); + if (symextn_sec == NULL) + { + symextn_sec = bfd_make_section (abfd, SYMEXTN_SECTION_NAME); + bfd_set_section_flags (abfd, symextn_sec, + SEC_LOAD | SEC_HAS_CONTENTS | SEC_DATA); + symextn_sec->output_section = symextn_sec; + symextn_sec->output_offset = 0; + bfd_set_section_alignment (abfd, symextn_sec, 2); + bfd_set_section_size (abfd, symextn_sec, symext_chain_size); + } + +} + +/* Perform any processing needed late in the object file writing process. + For PA ELF we build and set the contents of the symbol extension + section. */ + +static void +elf32_hppa_backend_final_write_processing (abfd) + bfd *abfd; +{ + asection *symextn_sec; + int i, *symtab_map = (int *) elf_sym_extra (abfd); + + /* Now build the symbol extension section. */ + if (symext_chain_size == 0) + return; + + /* Look at each symbol, adding the appropriate information to the + symbol extension section list as necessary. */ + for (i = 0; i < abfd->symcount; i++) + { + elf_symbol_type *symbol = (elf_symbol_type *) abfd->outsymbols[i]; + + /* Only functions ever need an entry in the symbol extension + section. */ + if (!(symbol->symbol.flags & BSF_FUNCTION)) + continue; + + /* And only if they specify the locations of their arguments. */ + if (symbol->tc_data.hppa_arg_reloc == 0) + continue; + + /* Add this symbol's information to the chain. */ + add_entry_to_symext_chain (abfd, symbol, symtab_map[i], + &symext_rootP, &symext_lastP); + } + + /* Now fill in the contents of the symbol extension chain. */ + elf_hppa_tc_make_sections (abfd, symext_rootP); + + /* And attach that as the section's contents. */ + symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME); + if (symextn_sec == (asection *) 0) + abort(); + + symextn_sec->contents = (void *)symextn_contents; + + bfd_set_section_contents (abfd, symextn_sec, symextn_sec->contents, + symextn_sec->output_offset, symextn_sec->_raw_size); +} + /* Update the symbol extention chain to include the symbol pointed to by SYMBOLP if SYMBOLP is a function symbol. Used internally and by GAS. */ -void -elf_hppa_tc_symbol (abfd, symbolP, sym_idx, symext_root, symext_last) +static void +add_entry_to_symext_chain (abfd, symbol, sym_idx, symext_root, symext_last) bfd *abfd; - elf_symbol_type *symbolP; + elf_symbol_type *symbol; int sym_idx; symext_chainS **symext_root; symext_chainS **symext_last; { symext_chainS *symextP; - unsigned int arg_reloc; - - /* Only functions can have argument relocations. */ - if (!(symbolP->symbol.flags & BSF_FUNCTION)) - return; - - arg_reloc = symbolP->tc_data.hppa_arg_reloc; - - /* If there are no argument relocation bits, then no relocation is - necessary. Do not add this to the symextn section. */ - if (arg_reloc == 0) - return; + unsigned int arg_reloc = symbol->tc_data.hppa_arg_reloc; /* Allocate memory and initialize this entry. */ symextP = (symext_chainS *) bfd_alloc (abfd, sizeof (symext_chainS) * 2); @@ -1626,10 +1214,10 @@ elf_hppa_tc_symbol (abfd, symbolP, sym_idx, symext_root, symext_last) abort(); /* FIXME */ } - symextP[0].entry = ELF32_HPPA_SX_WORD (HPPA_SXT_SYMNDX, sym_idx); + symextP[0].entry = ELF32_PARISC_SX_WORD (PARISC_SXT_SYMNDX, sym_idx); symextP[0].next = &symextP[1]; - symextP[1].entry = ELF32_HPPA_SX_WORD (HPPA_SXT_ARG_RELOC, arg_reloc); + symextP[1].entry = ELF32_PARISC_SX_WORD (PARISC_SXT_ARG_RELOC, arg_reloc); symextP[1].next = NULL; /* Now update the chain itself so it can be walked later to build @@ -1648,54 +1236,31 @@ elf_hppa_tc_symbol (abfd, symbolP, sym_idx, symext_root, symext_last) /* Build the symbol extension section. Used internally and by GAS. */ -void +static void elf_hppa_tc_make_sections (abfd, symext_root) bfd *abfd; symext_chainS *symext_root; { symext_chainS *symextP; - int size, n, i; + int i; asection *symextn_sec; /* FIXME: Huh? I don't see what this is supposed to do for us. */ hppa_elf_stub_finish (abfd); - /* If there are no entries in the symbol extension chain, then - there is no symbol extension section. */ - if (symext_root == NULL) - return; - - /* Count the number of entries on the chain. */ - for (n = 0, symextP = symext_root; symextP; symextP = symextP->next, ++n) - ; - - /* Create the symbol extension section and set some appropriate - attributes. */ - size = sizeof (symext_entryS) * n; symextn_sec = bfd_get_section_by_name (abfd, SYMEXTN_SECTION_NAME); - if (symextn_sec == (asection *) 0) - { - symextn_sec = bfd_make_section (abfd, SYMEXTN_SECTION_NAME); - bfd_set_section_flags (abfd, - symextn_sec, - SEC_LOAD | SEC_HAS_CONTENTS | SEC_DATA); - symextn_sec->output_section = symextn_sec; - symextn_sec->output_offset = 0; - bfd_set_section_alignment (abfd, symextn_sec, 2); - } - bfd_set_section_size (abfd, symextn_sec, symextn_contents_real_size); - symextn_contents_real_size = size; /* Grab some memory for the contents of the symbol extension section itself. */ - symextn_contents = (symext_entryS *) bfd_alloc (abfd, size); + symextn_contents = (symext_entryS *) bfd_zalloc (abfd, + symextn_sec->_raw_size); if (!symextn_contents) { bfd_set_error (bfd_error_no_memory); abort(); /* FIXME */ } - /* Fill in the contents of the symbol extension section. */ + /* Fill in the contents of the symbol extension chain. */ for (i = 0, symextP = symext_root; symextP; symextP = symextP->next, ++i) symextn_contents[i] = symextP->entry; @@ -1712,10 +1277,10 @@ elf32_hppa_get_sym_extn (abfd, sym, type) { switch (type) { - case HPPA_SXT_SYMNDX: - case HPPA_SXT_NULL: + case PARISC_SXT_SYMNDX: + case PARISC_SXT_NULL: return (symext_entryS) 0; - case HPPA_SXT_ARG_RELOC: + case PARISC_SXT_ARG_RELOC: { elf_symbol_type *esymP = (elf_symbol_type *) sym; @@ -1929,7 +1494,7 @@ hppa_elf_stub_finish (output_bfd) { bfd *stub_bfd = stub_list->this_bfd; asection *stub_sec = bfd_get_section_by_name (stub_bfd, - ".hppa_linker_stubs"); + ".PARISC.stubs"); long reloc_size; arelent **reloc_vector; long reloc_count; @@ -2109,7 +1674,7 @@ hppa_elf_build_linker_stub (abfd, output_bfd, link_info, reloc_entry, unsigned insn = data[0]; asymbol *stub_sym = NULL; asymbol **orig_sym = reloc_entry->sym_ptr_ptr; - asection *stub_sec = bfd_get_section_by_name (abfd, ".hppa_linker_stubs"); + asection *stub_sec = bfd_get_section_by_name (abfd, ".PARISC.stubs"); elf32_hppa_stub_description *stub_desc = find_stubs (abfd, stub_sec); /* Perform some additional checks on whether we should really do the @@ -2150,13 +1715,13 @@ hppa_elf_build_linker_stub (abfd, output_bfd, link_info, reloc_entry, going to be calling one stub from another by the fact that the symbol name has '_stub_' (arg. reloc. stub) or '_lb_stub_' prepended to the name. Alternatively, the section of the - symbol will be '.hppa_linker_stubs'. This is only an issue + symbol will be '.PARISC.stubs'. This is only an issue for long-calls; they are the only stubs allowed to call another stub. */ if ((strncmp ((*orig_sym)->name, "_stub_", 6) == 0) || (strncmp ((*orig_sym)->name, "_lb_stub_", 9) == 0)) { - BFD_ASSERT (strcmp ((*orig_sym)->section->name, ".hppa_linker_stubs") + BFD_ASSERT (strcmp ((*orig_sym)->section->name, ".PARISC.stubs") == 0); rtn_adjust = false; } @@ -2230,11 +1795,11 @@ hppa_elf_build_linker_stub (abfd, output_bfd, link_info, reloc_entry, } reloc_entry->sym_ptr_ptr[0] = stub_sym; if (linker_stub_type == HPPA_STUB_LONG_CALL - || (reloc_entry->howto->type != R_HPPA_PLABEL_32 + || (reloc_entry->howto->type != R_PARISC_PLABEL32 && (get_opcode(insn) == BLE || get_opcode (insn) == BE || get_opcode (insn) == BL))) - reloc_entry->howto = bfd_reloc_type_lookup (abfd, R_HPPA_STUB_CALL_17); + reloc_entry->howto = bfd_reloc_type_lookup (abfd, R_PARISC_STUB_CALL_17); } else { @@ -2269,11 +1834,11 @@ hppa_elf_build_linker_stub (abfd, output_bfd, link_info, reloc_entry, } reloc_entry->sym_ptr_ptr[0] = stub_sym; if (linker_stub_type == HPPA_STUB_LONG_CALL - || (reloc_entry->howto->type != R_HPPA_PLABEL_32 + || (reloc_entry->howto->type != R_PARISC_PLABEL32 && (get_opcode (insn) == BLE || get_opcode (insn) == BE || get_opcode (insn) == BL))) - reloc_entry->howto = bfd_reloc_type_lookup (abfd, R_HPPA_STUB_CALL_17); + reloc_entry->howto = bfd_reloc_type_lookup (abfd, R_PARISC_STUB_CALL_17); /* Now generate the code for the stub. Starting with two common instructions. @@ -2449,12 +2014,12 @@ hppa_elf_build_linker_stub (abfd, output_bfd, link_info, reloc_entry, hppa_elf_stub_reloc (stub_entry->stub_desc, abfd, orig_sym, CURRENT_STUB_OFFSET (stub_entry), - R_HPPA_L21); + R_PARISC_DIR21L); NEW_INSTRUCTION (stub_entry, BLE_XXX_0_31) hppa_elf_stub_reloc (stub_entry->stub_desc, abfd, orig_sym, CURRENT_STUB_OFFSET (stub_entry), - R_HPPA_ABS_CALL_R17); + R_PARISC_DIR17R); if (linker_stub_type == HPPA_STUB_ARG_RELOC) { @@ -2531,7 +2096,7 @@ hppa_elf_arg_reloc_needed_p (abfd, reloc_entry, stub_types, caller_ar) { symext_entryS callee_ar = elf32_hppa_get_sym_extn (abfd, reloc_entry->sym_ptr_ptr[0], - HPPA_SXT_ARG_RELOC); + PARISC_SXT_ARG_RELOC); /* Now examine all the argument and return value location information to determine if a relocation stub will be needed. */ @@ -2622,7 +2187,7 @@ hppa_elf_create_stub_sec (abfd, output_bfd, secptr, link_info) asection *output_text_section; output_text_section = bfd_get_section_by_name (output_bfd, ".text"); - *secptr = bfd_make_section (abfd, ".hppa_linker_stubs"); + *secptr = bfd_make_section (abfd, ".PARISC.stubs"); bfd_set_section_flags (abfd, *secptr, SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_READONLY); @@ -2787,43 +2352,12 @@ hppa_look_for_stubs_in_section (stub_bfd, abfd, output_bfd, asec, { /* Any call could need argument relocation stubs, and some may need long-call stubs. */ - case R_HPPA_ABS_CALL_11: - case R_HPPA_ABS_CALL_14: - case R_HPPA_ABS_CALL_17: - case R_HPPA_ABS_CALL_L21: - case R_HPPA_ABS_CALL_R11: - case R_HPPA_ABS_CALL_R14: - case R_HPPA_ABS_CALL_R17: - case R_HPPA_ABS_CALL_LS21: - case R_HPPA_ABS_CALL_RS11: - case R_HPPA_ABS_CALL_RS14: - case R_HPPA_ABS_CALL_RS17: - case R_HPPA_ABS_CALL_LD21: - case R_HPPA_ABS_CALL_RD11: - case R_HPPA_ABS_CALL_RD14: - case R_HPPA_ABS_CALL_RD17: - case R_HPPA_ABS_CALL_LR21: - case R_HPPA_ABS_CALL_RR14: - case R_HPPA_ABS_CALL_RR17: - case R_HPPA_PCREL_CALL_11: - case R_HPPA_PCREL_CALL_14: - case R_HPPA_PCREL_CALL_17: - case R_HPPA_PCREL_CALL_12: - case R_HPPA_PCREL_CALL_L21: - case R_HPPA_PCREL_CALL_R11: - case R_HPPA_PCREL_CALL_R14: - case R_HPPA_PCREL_CALL_R17: - case R_HPPA_PCREL_CALL_LS21: - case R_HPPA_PCREL_CALL_RS11: - case R_HPPA_PCREL_CALL_RS14: - case R_HPPA_PCREL_CALL_RS17: - case R_HPPA_PCREL_CALL_LD21: - case R_HPPA_PCREL_CALL_RD11: - case R_HPPA_PCREL_CALL_RD14: - case R_HPPA_PCREL_CALL_RD17: - case R_HPPA_PCREL_CALL_LR21: - case R_HPPA_PCREL_CALL_RR14: - case R_HPPA_PCREL_CALL_RR17: + case R_PARISC_PCREL21L: + case R_PARISC_PCREL17R: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL14R: + case R_PARISC_PCREL14F: { symext_entryS caller_ar = (symext_entryS) HPPA_R_ARG_RELOC (rle->addend); @@ -2891,12 +2425,9 @@ hppa_look_for_stubs_in_section (stub_bfd, abfd, output_bfd, asec, break; /* PLABELs may need argument relocation stubs. */ - case R_HPPA_PLABEL_32: - case R_HPPA_PLABEL_11: - case R_HPPA_PLABEL_14: - case R_HPPA_PLABEL_L21: - case R_HPPA_PLABEL_R11: - case R_HPPA_PLABEL_R14: + case R_PARISC_PLABEL32: + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL14R: { /* On a plabel relocation, assume the arguments of the caller are set up in general registers (indirect @@ -2927,9 +2458,9 @@ hppa_look_for_stubs_in_section (stub_bfd, abfd, output_bfd, asec, /* Determine whether a return adjustment (see the relocation code for relocation type - R_HPPA_STUB_CALL_17) is possible. Basically, + R_PARISC_STUB_CALL_17) is possible. Basically, determine whether we are looking at a branch or not. */ - if (rle->howto->type == R_HPPA_PLABEL_32) + if (rle->howto->type == R_PARISC_PLABEL32) rtn_adjust = false; else { @@ -2985,7 +2516,7 @@ hppa_elf_set_section_contents (abfd, section, location, offset, count) bfd_size_type count; { /* Linker stubs are handled a little differently. */ - if (! strcmp (section->name, ".hppa_linker_stubs")) + if (! strcmp (section->name, ".PARISC.stubs")) { if (linker_stubs_max_size < offset + count) { @@ -3002,9 +2533,11 @@ hppa_elf_set_section_contents (abfd, section, location, offset, count) memcpy(linker_stubs + offset, location, count); return (true); } + /* Ignore write requests for the symbol extension section until we've + had the chance to rebuild it ourselves. */ + else if (! strcmp (section->name, ".PARISC.symextn") && !symext_chain_size) + return true; else - /* For everything but the linker stub section, use the generic - code. */ return bfd_elf32_set_section_contents (abfd, section, location, offset, count); } @@ -3029,7 +2562,7 @@ hppa_elf_get_section_contents (abfd, section, location, offset, count) about the case where a final executable is read in and a user tries to get the contents of this section? In that case the contents would be on disk like everything else. */ - if (strcmp (section->name, ".hppa_linker_stubs") == 0) + if (strcmp (section->name, ".PARISC.stubs") == 0) { elf32_hppa_stub_description *stub_desc = find_stubs (abfd, section); @@ -3044,60 +2577,8 @@ hppa_elf_get_section_contents (abfd, section, location, offset, count) memcpy (location, stub_desc->stub_contents + offset, count); return (true); } - - /* The symbol extension section also needs special handling. Its - contents might be on the disk, in memory, or still need to - be generated. */ - else if (strcmp (section->name, ".hppa_symextn") == 0) - { - /* If there are no output sections, then read the contents of the - symbol extension section from disk. */ - if (section->output_section == NULL - && abfd->direction == read_direction) - { - return _bfd_generic_get_section_contents (abfd, section, location, - offset, count); - } - - /* If this is the first time through, and there are output sections, - then build the symbol extension section based on other information - contained in the BFD. */ - else if (! symext_chain_built) - { - int i; - int *symtab_map = - (int *) elf_sym_extra (section->output_section->owner); - - for (i = 0; i < section->output_section->owner->symcount; i++) - { - elf_hppa_tc_symbol (section->output_section->owner, - ((elf_symbol_type *) - section->output_section->owner->outsymbols[i]), - symtab_map[i], &symext_rootP, &symext_lastP); - } - symext_chain_built++; - elf_hppa_tc_make_sections (section->output_section->owner, - symext_rootP); - } - - /* At this point we know that the symbol extension section has been - built. We just need to copy it into the user's buffer. */ - if (count == 0) - return true; - - /* Sanity check our arguments. */ - if ((bfd_size_type) (offset + count) > section->_raw_size - || (bfd_size_type) (offset + count) > symextn_contents_real_size) - return (false); - - memcpy (location, - (char *)symextn_contents + section->output_offset + offset, - count); - return (true); - } else - /* It's not the symbol extension or linker stub sections, use - the generic routines. */ + /* It's not the linker stub section, use the generic routines. */ return _bfd_generic_get_section_contents (abfd, section, location, offset, count); } @@ -3110,7 +2591,7 @@ elf_info_to_howto (abfd, cache_ptr, dst) arelent *cache_ptr; Elf32_Internal_Rela *dst; { - BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_HPPA_UNIMPLEMENTED); + BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_PARISC_UNIMPLEMENTED); cache_ptr->howto = &elf_hppa_howto_table[ELF32_R_TYPE (dst->r_info)]; } @@ -3174,15 +2655,15 @@ elf32_hppa_backend_symbol_table_processing (abfd, esyms,symcnt) for (i = 0; i < symextn_hdr->size / sizeof(symext_entryS); i++) { symext_entryS *seP = ((symext_entryS *)symextn_hdr->contents) + i; - int se_value = ELF32_HPPA_SX_VAL (*seP); - int se_type = ELF32_HPPA_SX_TYPE (*seP); + int se_value = ELF32_PARISC_SX_VAL (*seP); + int se_type = ELF32_PARISC_SX_TYPE (*seP); switch (se_type) { - case HPPA_SXT_NULL: + case PARISC_SXT_NULL: break; - case HPPA_SXT_SYMNDX: + case PARISC_SXT_SYMNDX: if (se_value >= symcnt) { bfd_set_error (bfd_error_bad_value); @@ -3191,7 +2672,7 @@ elf32_hppa_backend_symbol_table_processing (abfd, esyms,symcnt) current_sym_idx = se_value - 1; break; - case HPPA_SXT_ARG_RELOC: + case PARISC_SXT_ARG_RELOC: esyms[current_sym_idx].tc_data.hppa_arg_reloc = se_value; break; @@ -3214,20 +2695,20 @@ elf32_hppa_backend_section_processing (abfd, secthdr) { int i, j, k; - if (secthdr->sh_type == SHT_HPPA_SYMEXTN) + if (secthdr->sh_type == SHT_PARISC_SYMEXTN) { for (i = 0; i < secthdr->size / sizeof (symext_entryS); i++) { symext_entryS *seP = ((symext_entryS *)secthdr->contents) + i; - int se_value = ELF32_HPPA_SX_VAL (*seP); - int se_type = ELF32_HPPA_SX_TYPE (*seP); + int se_value = ELF32_PARISC_SX_VAL (*seP); + int se_type = ELF32_PARISC_SX_TYPE (*seP); switch (se_type) { - case HPPA_SXT_NULL: + case PARISC_SXT_NULL: break; - case HPPA_SXT_SYMNDX: + case PARISC_SXT_SYMNDX: for (j = 0; j < abfd->symcount; j++) { /* Locate the map entry for this symbol and modify the @@ -3242,14 +2723,14 @@ elf32_hppa_backend_section_processing (abfd, secthdr) == abfd->outsymbols[j]) { bfd_put_32(abfd, - ELF32_HPPA_SX_WORD (HPPA_SXT_SYMNDX, j), + ELF32_PARISC_SX_WORD (PARISC_SXT_SYMNDX, j), (char *)seP); } } } break; - case HPPA_SXT_ARG_RELOC: + case PARISC_SXT_ARG_RELOC: break; default: @@ -3273,9 +2754,9 @@ elf32_hppa_backend_section_from_shdr (abfd, hdr, name) { asection *newsect; - if (hdr->sh_type == SHT_HPPA_SYMEXTN) + if (hdr->sh_type == SHT_PARISC_SYMEXTN) { - BFD_ASSERT (strcmp (name, ".hppa_symextn") == 0); + BFD_ASSERT (strcmp (name, ".PARISC.symextn") == 0); /* Bits that get saved. This one is real. */ if (!hdr->rawdata) @@ -3320,16 +2801,16 @@ elf32_hppa_backend_fake_sections (abfd, secthdr, asect) asection *asect; { - if (strcmp(asect->name, ".hppa_symextn") == 0) + if (strcmp(asect->name, ".PARISC.symextn") == 0) { - secthdr->sh_type = SHT_HPPA_SYMEXTN; + secthdr->sh_type = SHT_PARISC_SYMEXTN; secthdr->sh_flags = 0; secthdr->sh_info = elf_section_data(asect)->rel_hdr.sh_link; secthdr->sh_link = elf_onesymtab(abfd); return true; } - if (!strcmp (asect->name, ".hppa_unwind")) + if (!strcmp (asect->name, ".PARISC.unwind")) { secthdr->sh_type = SHT_PROGBITS; /* Unwind descriptors are not part of the program memory image. */ @@ -3364,13 +2845,13 @@ elf32_hppa_backend_section_from_bfd_section (abfd, hdr, asect, ignored) asection *asect; int *ignored; { - if (hdr->sh_type == SHT_HPPA_SYMEXTN) + if (hdr->sh_type == SHT_PARISC_SYMEXTN) { if (hdr->rawdata) { if (((struct sec *) (hdr->rawdata)) == asect) { - BFD_ASSERT (strcmp (asect->name, ".hppa_symextn") == 0); + BFD_ASSERT (strcmp (asect->name, ".PARISC.symextn") == 0); return true; } } @@ -3404,11 +2885,15 @@ elf32_hppa_backend_section_from_bfd_section (abfd, hdr, asect, ignored) #define elf_backend_section_from_shdr elf32_hppa_backend_section_from_shdr #define elf_backend_fake_sections elf32_hppa_backend_fake_sections +#define elf_backend_begin_write_processing \ + elf32_hppa_backend_begin_write_processing +#define elf_backend_final_write_processing \ + elf32_hppa_backend_final_write_processing #define TARGET_BIG_SYM bfd_elf32_hppa_vec #define TARGET_BIG_NAME "elf32-hppa" #define ELF_ARCH bfd_arch_hppa -#define ELF_MACHINE_CODE EM_HPPA +#define ELF_MACHINE_CODE EM_PARISC #define ELF_MAXPAGESIZE 0x1000 #include "elf32-target.h" diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h index dadc411..188f6c6 100644 --- a/bfd/elf32-hppa.h +++ b/bfd/elf32-hppa.h @@ -4,7 +4,7 @@ in the Stratus FTX/Golf Object File Format (SED-1762) dated November 19, 1992. - Copyright (C) 1990-1991 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. Written by: @@ -33,248 +33,97 @@ #include "libelf.h" #include "libhppa.h" +#include "elf/hppa.h" /* ELF/HPPA relocation types */ typedef enum { - /* 9.3.4. Address relocation types - These relocation types do simple base + offset relocations. - - By convention, relocation type zero is always "no relocation", - while type one is 32-bit word relocation. */ - - R_HPPA_NONE, /* - - */ - R_HPPA_32, /* Symbol + Addend 32 */ - R_HPPA_11, /* Symbol + Addend 11 */ - R_HPPA_14, /* Symbol + Addend 11 */ - R_HPPA_17, /* Symbol + Addend 11 */ - R_HPPA_L21, /* L (Symbol, Addend) 21 */ - R_HPPA_R11, /* R (Symbol, Addend) 11 */ - R_HPPA_R14, /* R (Symbol, Addend) 14 */ - R_HPPA_R17, /* R (Symbol, Addend) 17 */ - R_HPPA_LS21, /* LS(Symbol, Addend) 21 */ - R_HPPA_RS11, /* RS(Symbol, Addend) 11 */ - R_HPPA_RS14, /* RS(Symbol, Addend) 14 */ - R_HPPA_RS17, /* RS(Symbol, Addend) 17 */ - R_HPPA_LD21, /* LD(Symbol, Addend) 21 */ - R_HPPA_RD11, /* RD(Symbol, Addend) 11 */ - R_HPPA_RD14, /* RD(Symbol, Addend) 14 */ - R_HPPA_RD17, /* RD(Symbol, Addend) 17 */ - R_HPPA_LR21, /* LR(Symbol, Addend) 21 */ - R_HPPA_RR14, /* RR(Symbol, Addend) 14 */ - R_HPPA_RR17, /* RR(Symbol, Addend) 17 */ - - /* 9.3.5. GOTOFF address relocation types - - The Global Offset Table (GOT) is a table of pointers to data, but - its address can also be used as a base pointer to address data, - similar to the way the DP is used in HP/UX. The expression - calculation yields a signed offset of an address from the GOT. */ - - R_HPPA_GOTOFF_11, /* Symbol - GOT + Addend 11 */ - R_HPPA_GOTOFF_14, /* Symbol - GOT + Addend 14 */ - R_HPPA_GOTOFF_L21, /* L (Sym - GOT, Addend) 21 */ - R_HPPA_GOTOFF_R11, /* R (Sym - GOT, Addend) 11 */ - R_HPPA_GOTOFF_R14, /* R (Sym - GOT, Addend) 14 */ - R_HPPA_GOTOFF_LS21, /* LS(Sym - GOT, Addend) 21 */ - R_HPPA_GOTOFF_RS11, /* RS(Sym - GOT, Addend) 11 */ - R_HPPA_GOTOFF_RS14, /* RS(Sym - GOT, Addend) 14 */ - R_HPPA_GOTOFF_LD21, /* LD(Sym - GOT, Addend) 21 */ - R_HPPA_GOTOFF_RD11, /* RD(Sym - GOT, Addend) 11 */ - R_HPPA_GOTOFF_RD14, /* RD(Sym - GOT, Addend) 14 */ - R_HPPA_GOTOFF_LR21, /* LR(Sym - GOT, Addend) 21 */ - R_HPPA_GOTOFF_RR14, /* RR(Sym - GOT, Addend) 14 */ - - /* 9.3.6. Absolute call relocation types - - Relocations of function calls must be accompanied by parameter - relocation information. This information is carried in the ten - high-order bits of the addend field. The remaining 22 bits of - of the addend field are sign-extended to form the Addend. + /* Address relocation types + These relocation types do simple base + offset relocations. */ + + R_PARISC_NONE = 0x00, + R_PARISC_DIR32 = 0x01, + R_PARISC_DIR21L = 0x02, + R_PARISC_DIR17R = 0x03, + R_PARISC_DIR17F = 0x04, + R_PARISC_DIR14R = 0x06, + + /* PC-relative relocation types + Typically used for calls. + Note PCREL17C and PCREL17F differ only in overflow handling. + PCREL17C never reports a relocation error. + + When supporting argument relocations, function calls must be + accompanied by parameter relocation information. This information is + carried in the ten high-order bits of the addend field. The remaining + 22 bits of of the addend field are sign-extended to form the Addend. Note the code to build argument relocations depends on the addend being zero. A consequence of this limitation is GAS can not perform relocation reductions for function symbols. */ + R_PARISC_PCREL21L = 0x0a, + R_PARISC_PCREL17R = 0x0b, + R_PARISC_PCREL17F = 0x0c, + R_PARISC_PCREL17C = 0x0d, + R_PARISC_PCREL14R = 0x0e, + R_PARISC_PCREL14F = 0x0f, - R_HPPA_ABS_CALL_11, /* Symbol + Addend 11 */ - R_HPPA_ABS_CALL_14, /* Symbol + Addend 14 */ - R_HPPA_ABS_CALL_17, /* Symbol + Addend 17 */ - R_HPPA_ABS_CALL_L21, /* L (Symbol, Addend) 21 */ - R_HPPA_ABS_CALL_R11, /* R (Symbol, Addend) 11 */ - R_HPPA_ABS_CALL_R14, /* R (Symbol, Addend) 14 */ - R_HPPA_ABS_CALL_R17, /* R (Symbol, Addend) 17 */ - R_HPPA_ABS_CALL_LS21, /* LS(Symbol, Addend) 21 */ - R_HPPA_ABS_CALL_RS11, /* RS(Symbol, Addend) 11 */ - R_HPPA_ABS_CALL_RS14, /* RS(Symbol, Addend) 14 */ - R_HPPA_ABS_CALL_RS17, /* RS(Symbol, Addend) 17 */ - R_HPPA_ABS_CALL_LD21, /* LD(Symbol, Addend) 21 */ - R_HPPA_ABS_CALL_RD11, /* RD(Symbol, Addend) 11 */ - R_HPPA_ABS_CALL_RD14, /* RD(Symbol, Addend) 14 */ - R_HPPA_ABS_CALL_RD17, /* RD(Symbol, Addend) 17 */ - R_HPPA_ABS_CALL_LR21, /* LR(Symbol, Addend) 21 */ - R_HPPA_ABS_CALL_RR14, /* RR(Symbol, Addend) 14 */ - R_HPPA_ABS_CALL_RR17, /* RR(Symbol, Addend) 17 */ - - /* 9.3.7. PC-relative call relocation types - - PC-relative relocation calculates the difference between an address - and the location being relocated. This is most often used to - relocate pc-relative calls. They are otherwise identical to - their corresponding absolute call relocations. */ - - R_HPPA_PCREL_CALL_11, /* Symbol - PC + Addend 11 */ - R_HPPA_PCREL_CALL_14, /* Symbol - PC + Addend 14 */ - R_HPPA_PCREL_CALL_17, /* Symbol - PC + Addend 17 */ - R_HPPA_PCREL_CALL_12, /* Symbol - PC + Addend 12 */ - R_HPPA_PCREL_CALL_L21, /* L (Symbol - PC, Addend) 21 */ - R_HPPA_PCREL_CALL_R11, /* R (Symbol - PC, Addend) 11 */ - R_HPPA_PCREL_CALL_R14, /* R (Symbol - PC, Addend) 14 */ - R_HPPA_PCREL_CALL_R17, /* R (Symbol - PC, Addend) 17 */ - R_HPPA_PCREL_CALL_LS21, /* LS(Symbol - PC, Addend) 21 */ - R_HPPA_PCREL_CALL_RS11, /* RS(Symbol - PC, Addend) 11 */ - R_HPPA_PCREL_CALL_RS14, /* RS(Symbol - PC, Addend) 14 */ - R_HPPA_PCREL_CALL_RS17, /* RS(Symbol - PC, Addend) 17 */ - R_HPPA_PCREL_CALL_LD21, /* LD(Symbol - PC, Addend) 21 */ - R_HPPA_PCREL_CALL_RD11, /* RD(Symbol - PC, Addend) 11 */ - R_HPPA_PCREL_CALL_RD14, /* RD(Symbol - PC, Addend) 14 */ - R_HPPA_PCREL_CALL_RD17, /* RD(Symbol - PC, Addend) 17 */ - R_HPPA_PCREL_CALL_LR21, /* LR(Symbol - PC, Addend) 21 */ - R_HPPA_PCREL_CALL_RR14, /* RR(Symbol - PC, Addend) 14 */ - R_HPPA_PCREL_CALL_RR17, /* RR(Symbol - PC, Addend) 17 */ - - /* 9.3.8. Plabel relocation types - - Plabels are designed to allow code pointers to be passed between - spaces. - - Plabels are procedure markers. They are used to denote relocations - which involve procedures (call, loading the address of a procedure, - etc). They are necessary for the proper functioning of argument - relocations. The addend of the relocation should be either 0 (no - static link) or 2 (static link required). These relocations - correspond to the P%, LP% and RP% field selectors. */ - - R_HPPA_PLABEL_32, /* F(Plabel(Symbol,Addend),0) 32 */ - R_HPPA_PLABEL_11, /* F(Plabel(Symbol,Addend),0) 11 */ - R_HPPA_PLABEL_14, /* F(Plabel(Symbol,Addend),0) 14 */ - R_HPPA_PLABEL_L21, /* L(Plabel(Symbol,Addend),0) 21 */ - R_HPPA_PLABEL_R11, /* R(Plabel(Symbol,Addend),0) 11 */ - R_HPPA_PLABEL_R14, /* R(Plabel(Symbol,Addend),0) 14 */ - - /* 9.3.9. Data linkage table (DLT) relocation types + /* DP-relative relocation types. */ + R_PARISC_DPREL21L = 0x12, + R_PARISC_DPREL14R = 0x16, + R_PARISC_DPREL14F = 0x17, + + /* Data linkage table (DLT) relocation types SOM DLT_REL fixup requests are used to for static data references from position-independent code within shared libraries. They are similar to the GOT relocation types in some SVR4 implementations. */ - R_HPPA_DLT_32, /* F(DLTOFF) 32 */ - R_HPPA_DLT_11, /* F(DLTOFF) 11 */ - R_HPPA_DLT_14, /* F(DLTOFF) 14 */ - R_HPPA_DLT_L21, /* L(DLTOFF) 21 */ - R_HPPA_DLT_R11, /* R(DLTOFF) 11 */ - R_HPPA_DLT_R14, /* R(DLTOFF) 14 */ - - /* 9.3.10. Relocations for unwinder tables - - The unwinder table consists of a series of four-word entries, the - first two of which are a pair of code addresses. While it would be - possible to relocate this table using just R_HPPA_32, the amount of - relocation data resulting would be very large. To reduce that data, - the following relocation types have been defined. - - The first, R_HPPA_UNWIND_ENTRY, merely compresses two R_HPPA_32 - operations into one. It is designed for use in .rel-type - relocations, where the two 32-bit addends are taken from the unwind - section itself. - - The second, which is designed for use in .rela-type relocations, is - designed to relocate an entire unwinder table with one relocation - entry. It has the effect of multiple R_HPPA_UNWIND_ENTRY - relocations applied to successive unwinder table entries. The - number of entries to be relocated is given in the r_addend field of - the relocation entry. The rest of the relocation entry is used in - a normal way--r_offset is the offset of the first unwind entry in - the section, while ELF32_R_SYM(r_info) is the code section that all - the code addresses should be relocated from. - - Why can't we use begin/end markers + unwind description bits like - som? FIXME! */ - - R_HPPA_UNWIND_ENTRY, /* "128" */ - R_HPPA_UNWIND_ENTRIES, /* Addend * "128" */ - - /* 9.3.11. Relocation types for complex expressions - - New-format SOM fixups support complex expressions by spreading - the parts of the expression across multiple entries. ELF for - HPPA will have a similar mechanism, although support for it may - be optional. There are two main reasons for defining it: first, - the need to translate complex SOM fixup expressions to ELF, and - second, to cover combinations of expression, field and format not - available with other relocation types. - - ELF expression relocation entries are interpreted as postfix-form - expressions. They may be evaluated using a push-down stack. - - Usually, the addend field of these expression relocation entries is - unused, with the following exceptions: - - R_HPPA_PUSH_CONST: The addend field contains the constant. - - R_HPPA_PUSH_PROC: The high-order 10 bits of the addend field - contain parameter relocation information. The rest ofthe addend - field is unused. - - R_HPPA_LSHIFT, R_HPPA_ARITH_RSHIFT and R_HPPA_LOGIC_RSHIFT: - The addend field normally gives the amount to shift. - However, if that amount is zero, the shift amount is - popped from the top of the stack prior to popping the - amount to be shifted. */ - - R_HPPA_PUSH_CONST, /* push Addend - - */ - R_HPPA_PUSH_PC, /* push PC + Addend - - */ - R_HPPA_PUSH_SYM, /* push Symbol + Addend - - */ - R_HPPA_PUSH_GOTOFF, /* push Symbol - GOT + Addend - - */ - R_HPPA_PUSH_ABS_CALL, /* push Symbol + Addend - - */ - R_HPPA_PUSH_PCREL_CALL, /* push Symbol - PC + Addend - - */ - R_HPPA_PUSH_PLABEL, /* push Plabel(Symbol) - - */ - R_HPPA_MAX, /* pop A and B, push max(B,A) - - */ - R_HPPA_MIN, /* pop A and B, push min(B,A) - - */ - R_HPPA_ADD, /* pop A and B, push B + A - - */ - R_HPPA_SUB, /* pop A and B, push B - A - - */ - R_HPPA_MULT, /* pop A and B, push B * A - - */ - R_HPPA_DIV, /* pop A and B, push B / A - - */ - R_HPPA_MOD, /* pop A and B, push B % A - - */ - R_HPPA_AND, /* pop A and B, push B & A - - */ - R_HPPA_OR, /* pop A and B, push B | A - - */ - R_HPPA_XOR, /* pop A and B, push B ^ A - - */ - R_HPPA_NOT, /* pop A, push ~A - - */ - R_HPPA_LSHIFT, /* pop A, push A << Addend - - */ - R_HPPA_ARITH_RSHIFT, /* pop A, push A >> Addend - - */ - R_HPPA_LOGIC_RSHIFT, /* pop A, push A >> Addend - - */ - R_HPPA_EXPR_F, /* pop A, push A + Addend F - */ - R_HPPA_EXPR_L, /* pop A, push L(A,Addend) L - */ - R_HPPA_EXPR_R, /* pop A, push R(A,Addend) R - */ - R_HPPA_EXPR_LS, /* pop A, push LS(A,Addend) LS - */ - R_HPPA_EXPR_RS, /* pop A, push RS(A,Addend) RS - */ - R_HPPA_EXPR_LD, /* pop A, push LD(A,Addend) LD - */ - R_HPPA_EXPR_RD, /* pop A, push RD(A,Addend) RD - */ - R_HPPA_EXPR_LR, /* pop A, push LR(A,Addend) LR - */ - R_HPPA_EXPR_RR, /* pop A, push RR(A,Addend) RR - */ - R_HPPA_EXPR_32, /* pop - 32 */ - R_HPPA_EXPR_21, /* pop - 21 */ - R_HPPA_EXPR_11, /* pop - 11 */ - R_HPPA_EXPR_14, /* pop - 14 */ - R_HPPA_EXPR_17, /* pop - 17 */ - R_HPPA_EXPR_12, /* pop - 12 */ - R_HPPA_STUB_CALL_17, /* Symbol + Addend - 17 */ - R_HPPA_UNIMPLEMENTED /* N/A */ + R_PARISC_DLTREL21L = 0x1a, + R_PARISC_DLTREL14R = 0x1e, + R_PARISC_DLTREL14F = 0x1f, + + /* DLT indirect relocation types */ + R_PARISC_DLTIND21L = 0x22, + R_PARISC_DLTIND14R = 0x26, + R_PARISC_DLTIND14F = 0x27, + + /* Base relative relocation types. Ugh. These imply lots of state */ + R_PARISC_SETBASE = 0x28, + R_PARISC_BASEREL32 = 0x29, + R_PARISC_BASEREL21L = 0x2a, + R_PARISC_BASEREL17R = 0x2b, + R_PARISC_BASEREL17F = 0x2c, + R_PARISC_BASEREL14R = 0x2e, + R_PARISC_BASEREL14F = 0x2f, + + /* Segment relative relocation types. */ + R_PARISC_TEXTREL32 = 0x31, + R_PARISC_DATAREL32 = 0x39, + + /* Plabel relocation types. */ + R_PARISC_PLABEL32 = 0x41, + R_PARISC_PLABEL21L = 0x42, + R_PARISC_PLABEL14R = 0x46, + + /* PLT relocations. */ + R_PARISC_PLTIND21L = 0x82, + R_PARISC_PLTIND14R = 0x86, + R_PARISC_PLTIND14F = 0x87, + + /* Misc relocation types. */ + R_PARISC_COPY = 0x88, + R_PARISC_GLOB_DAT = 0x89, + R_PARISC_JMP_SLOT = 0x8a, + R_PARISC_RELATIVE = 0x8b, + R_PARISC_STUB_CALL_17 = 0x8c, + R_PARISC_UNIMPLEMENTED, } elf32_hppa_reloc_type; -#define ELF_HOWTO_TABLE_SIZE R_HPPA_UNIMPLEMENTED + 1 -#define N_HPPA_RELOCS R_HPPA_UNIMPLEMENTED + 1 +#define ELF_HOWTO_TABLE_SIZE R_PARISC_UNIMPLEMENTED + 1 +#define N_PARISC_RELOCS R_PARISC_UNIMPLEMENTED + 1 /* Define groups of basic relocations. FIXME: These should be the only basic relocations created by GAS. The rest @@ -285,40 +134,28 @@ elf32_hppa_reloc_type; as appropriate. This allows GAS to share much more code between the two target object formats. */ -#define R_HPPA R_HPPA_32 -#define R_HPPA_GOTOFF R_HPPA_GOTOFF_11 -#define R_HPPA_ABS_CALL R_HPPA_ABS_CALL_11 -#define R_HPPA_PCREL_CALL R_HPPA_PCREL_CALL_11 -#define R_HPPA_PLABEL R_HPPA_PLABEL_32 -#define R_HPPA_DLT R_HPPA_DLT_32 -#define R_HPPA_UNWIND R_HPPA_UNWIND_ENTRY -#define R_HPPA_COMPLEX R_HPPA_PUSH_CONST -#define R_HPPA_COMPLEX_PCREL_CALL R_HPPA_PUSH_CONST + 1 -#define R_HPPA_COMPLEX_ABS_CALL R_HPPA_PUSH_CONST + 2 - -/* HPPA Section types */ -#define SHT_HPPA_SYMEXTN SHT_LOPROC - -/* HPPA Symbol types */ -#define STT_HPPA_PLABEL STT_LOPROC +#define R_HPPA_NONE R_PARISC_NONE +#define R_HPPA R_PARISC_DIR32 +#define R_HPPA_GOTOFF R_PARISC_DPREL21L +#define R_HPPA_PCREL_CALL R_PARISC_PCREL21L /* HPPA symbol table extension entry types */ enum elf32_hppa_symextn_types { - HPPA_SXT_NULL, - HPPA_SXT_SYMNDX, - HPPA_SXT_ARG_RELOC, + PARISC_SXT_NULL, + PARISC_SXT_SYMNDX, + PARISC_SXT_ARG_RELOC, }; /* These macros compose and decompose the value of a symextn entry: - entry_type = ELF32_HPPA_SX_TYPE(word); - entry_value = ELF32_HPPA_SX_VAL(word); - word = ELF32_HPPA_SX_WORD(type,val); */ + entry_type = ELF32_PARISC_SX_TYPE(word); + entry_value = ELF32_PARISC_SX_VAL(word); + word = ELF32_PARISC_SX_WORD(type,val); */ -#define ELF32_HPPA_SX_TYPE(p) ((p) >> 24) -#define ELF32_HPPA_SX_VAL(p) ((p) & 0xFFFFFF) -#define ELF32_HPPA_SX_WORD(type,val) (((type) << 24) + (val & 0xFFFFFF)) +#define ELF32_PARISC_SX_TYPE(p) ((p) >> 24) +#define ELF32_PARISC_SX_VAL(p) ((p) & 0xFFFFFF) +#define ELF32_PARISC_SX_WORD(type,val) (((type) << 24) + (val & 0xFFFFFF)) /* The following was added facilitate implementation of the .hppa_symextn section. This section is built after the symbol table is built in the @@ -329,7 +166,7 @@ enum elf32_hppa_symextn_types /* Number of "hand-made" target specific sections. */ #define ELF_TC_FAKE_SECTIONS 1 -#define SYMEXTN_SECTION_NAME ".hppa_symextn" +#define SYMEXTN_SECTION_NAME ".PARISC.symext" /* FIXME. Are these external? (For example used by GAS?). If so the names need to change to avoid namespace pollution, if not they should @@ -343,9 +180,6 @@ struct symext_chain typedef struct symext_chain symext_chainS; -void elf_hppa_tc_symbol - PARAMS ((bfd *, elf_symbol_type *, int, symext_chainS **, symext_chainS **)); - elf32_hppa_reloc_type **hppa_elf_gen_reloc_type PARAMS ((bfd *, elf32_hppa_reloc_type, int, int)); @@ -354,6 +188,4 @@ asymbol * hppa_look_for_stubs_in_section int *, struct bfd_link_info *)); void elf_hppa_final_processing PARAMS ((void)); -void elf_hppa_tc_make_sections PARAMS ((bfd *, symext_chainS *)); - #endif /* _ELF32_HPPA_H */ diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 70fac03..2be7ea3 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -2053,18 +2053,6 @@ assign_file_positions_except_relocs (abfd, dosyms) off = assign_file_position_for_section (i_shdrp, off); if (exec_p - && i_shdrp->sh_type == SHT_NOBITS - && (i == i_ehdrp->e_shnum - || i_shdrpp[i + 1]->sh_type != SHT_NOBITS)) - { - /* Skip to the next page to ensure that when the file is - loaded the bss section is loaded with zeroes. I don't - know if this is required on all platforms, but it - shouldn't really hurt. */ - off = BFD_ALIGN (off, maxpagesize); - } - - if (exec_p && (abfd->flags & D_PAGED) != 0 && get_elf_backend_data (abfd)->maxpagesize > 1 && i_shdrp->sh_type == SHT_PROGBITS @@ -2161,7 +2149,7 @@ prep_headers (abfd) i_ehdrp->e_machine = EM_MIPS; /* only MIPS R3000 */ break; case bfd_arch_hppa: - i_ehdrp->e_machine = EM_HPPA; + i_ehdrp->e_machine = EM_PARISC; break; case bfd_arch_powerpc: i_ehdrp->e_machine = EM_CYGNUS_POWERPC; @@ -127,27 +127,48 @@ struct som_data_struct struct somdata a; }; +/* Substructure of som_section_data_struct used to hold information + which can't be represented by the generic BFD section structure, + but which must be copied during objcopy or strip. */ +struct som_copyable_section_data_struct + { + /* Various fields in space and subspace headers that we need + to pass around. */ + unsigned int sort_key : 8; + unsigned int access_control_bits : 7; + unsigned int is_defined : 1; + unsigned int is_private : 1; + unsigned int quadrant : 2; + + /* For subspaces, this points to the section which represents the + space in which the subspace is contained. For spaces it points + back to the section for this space. */ + asection *container; + + /* The user-specified space number. It is wrong to use this as + an index since duplicates and holes are allowed. */ + int space_number; + + /* Add more stuff here as needed. Good examples of information + we might want to pass would be initialization pointers, + and the many subspace flags we do not represent yet. */ + }; + /* Used to keep extra SOM specific information for a given section. reloc_size holds the size of the relocation stream, note this is very different from the number of relocations as SOM relocations are variable length. - reloc_stream is the actual stream of relocation entries. - - The BFD section index may not exactly match a SOM subspace index, - for this reason we keep track of the original SOM subspace index - when a subspace is turned into a BFD section. */ + reloc_stream is the actual stream of relocation entries. */ struct som_section_data_struct { - unsigned int is_space : 1; - unsigned int is_subspace : 1; + struct som_copyable_section_data_struct *copy_data; unsigned int reloc_size; char *reloc_stream; - asection *containing_space; - struct space_dictionary_record space_dict; - struct subspace_dictionary_record subspace_dict; + struct space_dictionary_record *space_dict; + struct subspace_dictionary_record *subspace_dict; }; #define somdata(bfd) ((bfd)->tdata.som_data->a) @@ -163,8 +184,7 @@ struct som_section_data_struct #define obj_som_reloc_filepos(bfd) (somdata(bfd).reloc_filepos) #define som_section_data(sec) \ ((struct som_section_data_struct *)sec->used_by_bfd) -#define som_symbol_data(symbol) \ - ((som_symbol_type *) symbol) +#define som_symbol_data(symbol) ((som_symbol_type *) symbol) /* Defines groups of basic relocations. FIXME: These should @@ -178,20 +198,16 @@ struct som_section_data_struct #define R_HPPA_NONE R_NO_RELOCATION #define R_HPPA R_CODE_ONE_SYMBOL -#define R_HPPA_ABS_CALL R_ABS_CALL #define R_HPPA_PCREL_CALL R_PCREL_CALL #define R_HPPA_GOTOFF R_DP_RELATIVE -#define R_HPPA_COMPLEX R_COMP1 -#define R_HPPA_COMPLEX_PCREL_CALL R_COMP2 -#define R_HPPA_COMPLEX_ABS_CALL R_COMP3 #define R_HPPA_ENTRY R_ENTRY #define R_HPPA_EXIT R_EXIT /* Exported functions, mostly for use by GAS. */ -void bfd_som_set_section_attributes PARAMS ((asection *, int, int, - unsigned int, int)); -void bfd_som_set_subsection_attributes PARAMS ((asection *, asection *, - int, unsigned int, int)); +boolean bfd_som_set_section_attributes PARAMS ((asection *, int, int, + unsigned int, int)); +boolean bfd_som_set_subsection_attributes PARAMS ((asection *, asection *, + int, unsigned int, int)); void bfd_som_set_symbol_type PARAMS ((asymbol *, unsigned int)); void bfd_som_attach_unwind_info PARAMS ((asymbol *, char *)); boolean bfd_som_attach_aux_hdr PARAMS ((bfd *, int, char *)); |