diff options
-rw-r--r-- | bfd/ChangeLog | 21 | ||||
-rw-r--r-- | bfd/coff-a29k.c | 166 | ||||
-rw-r--r-- | bfd/coff-apollo.c | 82 | ||||
-rw-r--r-- | bfd/coff-arm.c | 639 | ||||
-rw-r--r-- | bfd/coff-i860.c | 7 | ||||
-rw-r--r-- | bfd/coff-rs6000.c | 7 | ||||
-rw-r--r-- | bfd/coff-tic80.c | 6 | ||||
-rw-r--r-- | bfd/elf-m10200.c | 14 | ||||
-rw-r--r-- | bfd/elf-m10300.c | 18 | ||||
-rw-r--r-- | bfd/elf32-arm.h | 124 | ||||
-rw-r--r-- | bfd/elf32-d10v.c | 330 | ||||
-rw-r--r-- | bfd/elf32-m32r.c | 11 | ||||
-rw-r--r-- | bfd/elf32-mcore.c | 9 | ||||
-rw-r--r-- | bfd/elf32-openrisc.c | 9 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 12 | ||||
-rw-r--r-- | bfd/elf32-sparc.c | 6 | ||||
-rw-r--r-- | bfd/elf32-v850.c | 4 | ||||
-rw-r--r-- | bfd/elfarm-nabi.c | 45 | ||||
-rw-r--r-- | bfd/elfarm-oabi.c | 629 |
19 files changed, 1140 insertions, 999 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c7f72b9..60dd5a2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,24 @@ +2001-08-25 Nick Clifton <nickc@cambridge.redhat.com> + + * coff-a29k.c: Add missing prototypes. + * coff-apollo.c: Add missing prototypes. + * coff-arm.c: Add missing prototypes. + * coff-i860.c: Add missing prototypes. + * coff-rs6000.c: Add missing prototypes. + * coff-tic80.c: Add missing prototypes. + * elf-m10200.c: Add missing prototypes. + * elf-m10300.c: Add missing prototypes. + * elf32-arm.h: Add missing prototypes. + * elf32-d10v.c: Add missing prototypes. + * elf32-m32r.c: Add missing prototypes. + * elf32-mcore.c: Add missing prototypes. + * elf32-openrisc.c: Add missing prototypes. + * elf32-sh.c: Add missing prototypes. + * elf32-sparc.c: Add missing prototypes. + * elf32-v850.c: Add missing prototypes. + * elfarm-nabi.c: Add missing prototypes. + * elfarm-oabi.c: Add missing prototypes. + 2001-08-25 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index b7b018c..d4ae1e1 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -37,6 +37,8 @@ static boolean coff_a29k_relocate_section static boolean coff_a29k_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, struct internal_reloc *, boolean *)); +static void reloc_processing + PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) @@ -47,7 +49,8 @@ static boolean coff_a29k_adjust_symndx #define SIGN_EXTEND_HWORD(HWORD) \ (((HWORD) ^ 0x8000) - 0x8000) -/* Provided the symbol, returns the value reffed */ +/* Provided the symbol, returns the value reffed. */ + static long get_symbol_value (symbol) asymbol *symbol; @@ -55,20 +58,16 @@ get_symbol_value (symbol) long relocation = 0; if (bfd_is_com_section (symbol->section)) - { - relocation = 0; - } + relocation = 0; else - { - relocation = symbol->value + - symbol->section->output_section->vma + - symbol->section->output_offset; - } + relocation = symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset; - return(relocation); + return relocation; } -/* this function is in charge of performing all the 29k relocations */ +/* This function is in charge of performing all the 29k relocations. */ static bfd_reloc_status_type a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, @@ -81,17 +80,15 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - /* the consth relocation comes in two parts, we have to remember - the state between calls, in these variables */ + /* The consth relocation comes in two parts, we have to remember + the state between calls, in these variables. */ static boolean part1_consth_active = false; static unsigned long part1_consth_value; - unsigned long insn; unsigned long sym_value; unsigned long unsigned_value; unsigned short r_type; long signed_value; - unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ bfd_byte *hit_data =addr + (bfd_byte *) (data); @@ -99,29 +96,29 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (output_bfd) { - /* Partial linking - do nothing */ + /* Partial linking - do nothing. */ reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; - } if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { - /* Keep the state machine happy in case we're called again */ + /* Keep the state machine happy in case we're called again. */ if (r_type == R_IHIHALF) { part1_consth_active = true; part1_consth_value = 0; } - return(bfd_reloc_undefined); + return bfd_reloc_undefined; } if ((part1_consth_active) && (r_type != R_IHCONST)) { part1_consth_active = false; *error_message = (char *) _("Missing IHCONST"); - return(bfd_reloc_dangerous); + + return bfd_reloc_dangerous; } sym_value = get_symbol_value(symbol_in); @@ -130,7 +127,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, { case R_IREL: insn = bfd_get_32 (abfd, hit_data); - /* Take the value in the field and sign extend it */ + /* Take the value in the field and sign extend it. */ signed_value = EXTRACT_HWORD(insn); signed_value = SIGN_EXTEND_HWORD(signed_value); signed_value <<= 2; @@ -142,21 +139,21 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, signed_value += sym_value + reloc_entry->addend; if ((signed_value & ~0x3ffff) == 0) { /* Absolute jmp/call */ - insn |= (1<<24); /* Make it absolute */ - /* FIXME: Should we change r_type to R_IABS */ + insn |= (1 << 24); /* Make it absolute */ + /* FIXME: Should we change r_type to R_IABS. */ } else { /* Relative jmp/call, so subtract from the value the - address of the place we're coming from */ + address of the place we're coming from. */ signed_value -= (reloc_entry->address + input_section->output_section->vma + input_section->output_offset); - if (signed_value>0x1ffff || signed_value<-0x20000) - return(bfd_reloc_overflow); + if (signed_value > 0x1ffff || signed_value < -0x20000) + return bfd_reloc_overflow; } signed_value >>= 2; - insn = INSERT_HWORD(insn, signed_value); + insn = INSERT_HWORD (insn, signed_value); bfd_put_32 (abfd, insn ,hit_data); break; case R_ILOHALF: @@ -169,19 +166,19 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, case R_IHIHALF: insn = bfd_get_32 (abfd, hit_data); /* consth, part 1 - Just get the symbol value that is referenced */ + Just get the symbol value that is referenced. */ part1_consth_active = true; part1_consth_value = sym_value + reloc_entry->addend; - /* Don't modify insn until R_IHCONST */ + /* Don't modify insn until R_IHCONST. */ break; case R_IHCONST: insn = bfd_get_32 (abfd, hit_data); /* consth, part 2 - Now relocate the reference */ + Now relocate the reference. */ if (part1_consth_active == false) { *error_message = (char *) _("Missing IHIHALF"); - return(bfd_reloc_dangerous); + return bfd_reloc_dangerous; } /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */ unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/ @@ -196,14 +193,14 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, insn = bfd_get_8 (abfd, hit_data); unsigned_value = insn + sym_value + reloc_entry->addend; if (unsigned_value & 0xffffff00) - return(bfd_reloc_overflow); + return bfd_reloc_overflow; bfd_put_8 (abfd, unsigned_value, hit_data); break; case R_HWORD: insn = bfd_get_16 (abfd, hit_data); unsigned_value = insn + sym_value + reloc_entry->addend; if (unsigned_value & 0xffff0000) - return(bfd_reloc_overflow); + return bfd_reloc_overflow; bfd_put_16 (abfd, insn, hit_data); break; case R_WORD: @@ -213,61 +210,48 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, break; default: *error_message = _("Unrecognized reloc"); - return (bfd_reloc_dangerous); + return bfd_reloc_dangerous; } return(bfd_reloc_ok); } -/* type rightshift - size - bitsize - pc-relative - bitpos - absolute - complain_on_overflow - special_function - relocation name - partial_inplace - src_mask -*/ - -/*FIXME: I'm not real sure about this table */ +/*FIXME: I'm not real sure about this table. */ static reloc_howto_type howto_table[] = -{ - {R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, - EMPTY_HOWTO (1), - EMPTY_HOWTO (2), - EMPTY_HOWTO (3), - EMPTY_HOWTO (4), - EMPTY_HOWTO (5), - EMPTY_HOWTO (6), - EMPTY_HOWTO (7), - EMPTY_HOWTO (8), - EMPTY_HOWTO (9), - EMPTY_HOWTO (10), - EMPTY_HOWTO (11), - EMPTY_HOWTO (12), - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), - EMPTY_HOWTO (20), - EMPTY_HOWTO (21), - EMPTY_HOWTO (22), - EMPTY_HOWTO (23), - {R_IREL, 0, 3, 32, true, 0, complain_overflow_signed,a29k_reloc,"IREL", true, 0xffffffff,0xffffffff, false}, - {R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS", true, 0xffffffff,0xffffffff, false}, - {R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false}, - {R_IHIHALF, 0, 3, 16, true, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", true, 0xffff0000,0xffff0000, false}, - {R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"IHCONST", true, 0xffff0000,0xffff0000, false}, - {R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", true, 0x000000ff,0x000000ff, false}, - {R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", true, 0x0000ffff,0x0000ffff, false}, - {R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"WORD", true, 0xffffffff,0xffffffff, false}, -}; + { + {R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, + EMPTY_HOWTO (1), + EMPTY_HOWTO (2), + EMPTY_HOWTO (3), + EMPTY_HOWTO (4), + EMPTY_HOWTO (5), + EMPTY_HOWTO (6), + EMPTY_HOWTO (7), + EMPTY_HOWTO (8), + EMPTY_HOWTO (9), + EMPTY_HOWTO (10), + EMPTY_HOWTO (11), + EMPTY_HOWTO (12), + EMPTY_HOWTO (13), + EMPTY_HOWTO (14), + EMPTY_HOWTO (15), + EMPTY_HOWTO (16), + EMPTY_HOWTO (17), + EMPTY_HOWTO (18), + EMPTY_HOWTO (19), + EMPTY_HOWTO (20), + EMPTY_HOWTO (21), + EMPTY_HOWTO (22), + EMPTY_HOWTO (23), + {R_IREL, 0, 3, 32, true, 0, complain_overflow_signed,a29k_reloc,"IREL", true, 0xffffffff,0xffffffff, false}, + {R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS", true, 0xffffffff,0xffffffff, false}, + {R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false}, + {R_IHIHALF, 0, 3, 16, true, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", true, 0xffff0000,0xffff0000, false}, + {R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"IHCONST", true, 0xffff0000,0xffff0000, false}, + {R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", true, 0x000000ff,0x000000ff, false}, + {R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", true, 0x0000ffff,0x0000ffff, false}, + {R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"WORD", true, 0xffffffff,0xffffffff, false}, + }; #define BADMAG(x) A29KBADMAG(x) @@ -304,21 +288,18 @@ reloc_processing (relent,reloc, symbols, abfd, section) else { asymbol *ptr; - relent->sym_ptr_ptr = symbols + obj_convert(abfd)[reloc->r_symndx]; + + relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; ptr = *(relent->sym_ptr_ptr); if (ptr && bfd_asymbol_bfd(ptr) == abfd - - && ((ptr->flags & BSF_OLD_COMMON)== 0)) - { - relent->addend = 0; - } + && ((ptr->flags & BSF_OLD_COMMON) == 0)) + relent->addend = 0; else - { - relent->addend = 0; - } + relent->addend = 0; + relent->address-= section->vma; if (reloc->r_type == R_IHIHALF) ihihalf_vaddr = relent->address; @@ -404,7 +385,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, } else { - if (h->root.type == bfd_link_hash_defined + if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; @@ -494,7 +475,6 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, insn = INSERT_HWORD (insn, signed_value); bfd_put_32 (input_bfd, (bfd_vma) insn, loc); - break; case R_ILOHALF: diff --git a/bfd/coff-apollo.c b/bfd/coff-apollo.c index 0a18dce..e8abcb7 100644 --- a/bfd/coff-apollo.c +++ b/bfd/coff-apollo.c @@ -1,5 +1,5 @@ /* BFD back-end for Apollo 68000 COFF binaries. - Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc. By Troy Rollo (troy@cbme.unsw.edu.au) Based on m68k standard COFF version Written by Cygnus Support. @@ -33,15 +33,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern reloc_howto_type apollocoff_howto_table[]; #else reloc_howto_type apollocoff_howto_table[] = -{ - HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), - HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), - HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), - HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), -}; + { + HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), + HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), + HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), + HOWTO (R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), + }; #endif /* not ONLY_DECLARE_RELOCS */ #ifndef BADMAG @@ -49,27 +49,27 @@ reloc_howto_type apollocoff_howto_table[] = #endif #define APOLLO_M68 1 /* Customize coffcode.h */ -/* Turn a howto into a reloc number */ +/* Turn a howto into a reloc number. */ + +extern void apollo_rtype2howto PARAMS ((arelent *, int)); +extern int apollo_howto2rtype PARAMS ((reloc_howto_type *)); +#ifndef ONLY_DECLARE_RELOCS -#ifdef ONLY_DECLARE_RELOCS -extern void apollo_rtype2howto PARAMS ((arelent *internal, int relocentry)); -extern int apollo_howto2rtype PARAMS ((reloc_howto_type *)); -#else void -apollo_rtype2howto(internal, relocentry) +apollo_rtype2howto (internal, relocentry) arelent *internal; int relocentry; { switch (relocentry) - { - case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; - case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; - case R_RELLONG: internal->howto = apollocoff_howto_table + 2; break; - case R_PCRBYTE: internal->howto = apollocoff_howto_table + 3; break; - case R_PCRWORD: internal->howto = apollocoff_howto_table + 4; break; - case R_PCRLONG: internal->howto = apollocoff_howto_table + 5; break; - case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break; - } + { + case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; + case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; + case R_RELLONG: internal->howto = apollocoff_howto_table + 2; break; + case R_PCRBYTE: internal->howto = apollocoff_howto_table + 3; break; + case R_PCRWORD: internal->howto = apollocoff_howto_table + 4; break; + case R_PCRLONG: internal->howto = apollocoff_howto_table + 5; break; + case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break; + } } int @@ -77,32 +77,32 @@ apollo_howto2rtype (internal) reloc_howto_type *internal; { if (internal->pc_relative) - { - switch (internal->bitsize) { - case 32: return R_PCRLONG; - case 16: return R_PCRWORD; - case 8: return R_PCRBYTE; + switch (internal->bitsize) + { + case 32: return R_PCRLONG; + case 16: return R_PCRWORD; + case 8: return R_PCRBYTE; + } } - } else - { - switch (internal->bitsize) - { - case 32: return R_RELLONG; - case 16: return R_RELWORD; - case 8: return R_RELBYTE; - } - } + { + switch (internal->bitsize) + { + case 32: return R_RELLONG; + case 16: return R_RELWORD; + case 8: return R_RELBYTE; + } + } return R_RELLONG; } #endif /* not ONLY_DECLARE_RELOCS */ #define RTYPE2HOWTO(internal, relocentry) \ - apollo_rtype2howto(internal, (relocentry)->r_type) + apollo_rtype2howto (internal, (relocentry)->r_type) #define SELECT_RELOC(external, internal) \ - external.r_type = apollo_howto2rtype(internal); + external.r_type = apollo_howto2rtype (internal); #include "coffcode.h" diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index bfedfdb..6488ee7 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -113,12 +113,13 @@ static boolean coff_arm_link_output_has_begun PARAMS ((bfd *, struct coff_final_link_info *)); static boolean coff_arm_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); +static void arm_emit_base_file_entry + PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. Given a function name, and its type, the stub can be found. The - name can be changed. The only requirement is the %s be present. - */ + name can be changed. The only requirement is the %s be present. */ #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" @@ -127,6 +128,7 @@ static boolean coff_arm_final_link_postscript #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" /* Used by the assembler. */ + static bfd_reloc_status_type coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -233,300 +235,300 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #endif static reloc_howto_type aoutarm_std_reloc_howto[] = -{ - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ + { #ifdef ARM_WINCE - EMPTY_HOWTO (-1), - HOWTO (ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO (ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO (ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO (ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - EMPTY_HOWTO (-1), - HOWTO (ARM_SECTION, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO (ARM_SECREL, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), + EMPTY_HOWTO (-1), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + EMPTY_HOWTO (-1), + HOWTO (ARM_SECTION, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_SECREL, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), #else /* not ARM_WINCE */ - HOWTO(ARM_8, /* type */ - 0, /* rightshift */ - 0, /* size */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - coff_arm_reloc, /* special_function */ - "ARM_8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - PCRELOFFSET /* pcrel_offset */), - HOWTO(ARM_16, - 0, - 1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_16", - true, - 0x0000ffff, - 0x0000ffff, - PCRELOFFSET), - HOWTO(ARM_32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO(ARM_26, - 2, - 2, - 24, - true, - 0, - complain_overflow_signed, - aoutarm_fix_pcrel_26 , - "ARM_26", - false, - 0x00ffffff, - 0x00ffffff, - PCRELOFFSET), - HOWTO(ARM_DISP8, - 0, - 0, - 8, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP8", - true, - 0x000000ff, - 0x000000ff, - true), - HOWTO( ARM_DISP16, - 0, - 1, - 16, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP16", - true, - 0x0000ffff, - 0x0000ffff, - true), - HOWTO( ARM_DISP32, - 0, - 2, - 32, - true, - 0, - complain_overflow_signed, - coff_arm_reloc, - "ARM_DISP32", - true, - 0xffffffff, - 0xffffffff, - true), - HOWTO( ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), - /* 8 is unused */ - EMPTY_HOWTO (-1), - HOWTO( ARM_NEG16, - 0, - -1, - 16, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG16", - true, - 0x0000ffff, - 0x0000ffff, - false), - HOWTO( ARM_NEG32, - 0, - -2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_NEG32", - true, - 0xffffffff, - 0xffffffff, - false), - HOWTO( ARM_RVA32, - 0, - 2, - 32, - false, - 0, - complain_overflow_bitfield, - coff_arm_reloc, - "ARM_RVA32", - true, - 0xffffffff, - 0xffffffff, - PCRELOFFSET), - HOWTO( ARM_THUMB9, - 1, - 1, - 8, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_9 , - "ARM_THUMB9", - false, - 0x000000ff, - 0x000000ff, - PCRELOFFSET), - HOWTO( ARM_THUMB12, - 1, - 1, - 11, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_12 , - "ARM_THUMB12", - false, - 0x000007ff, - 0x000007ff, - PCRELOFFSET), - HOWTO( ARM_THUMB23, - 1, - 2, - 22, - true, - 0, - complain_overflow_signed, - coff_thumb_pcrel_23 , - "ARM_THUMB23", - false, - 0x07ff07ff, - 0x07ff07ff, - PCRELOFFSET) + HOWTO (ARM_8, /* type */ + 0, /* rightshift */ + 0, /* size */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + coff_arm_reloc, /* special_function */ + "ARM_8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + PCRELOFFSET /* pcrel_offset */), + HOWTO (ARM_16, + 0, + 1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_16", + true, + 0x0000ffff, + 0x0000ffff, + PCRELOFFSET), + HOWTO (ARM_32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_26, + 2, + 2, + 24, + true, + 0, + complain_overflow_signed, + aoutarm_fix_pcrel_26 , + "ARM_26", + false, + 0x00ffffff, + 0x00ffffff, + PCRELOFFSET), + HOWTO (ARM_DISP8, + 0, + 0, + 8, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP8", + true, + 0x000000ff, + 0x000000ff, + true), + HOWTO (ARM_DISP16, + 0, + 1, + 16, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP16", + true, + 0x0000ffff, + 0x0000ffff, + true), + HOWTO (ARM_DISP32, + 0, + 2, + 32, + true, + 0, + complain_overflow_signed, + coff_arm_reloc, + "ARM_DISP32", + true, + 0xffffffff, + 0xffffffff, + true), + HOWTO (ARM_26D, + 2, + 2, + 24, + false, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + true, + 0x00ffffff, + 0x0, + false), + /* 8 is unused */ + EMPTY_HOWTO (-1), + HOWTO (ARM_NEG16, + 0, + -1, + 16, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG16", + true, + 0x0000ffff, + 0x0000ffff, + false), + HOWTO (ARM_NEG32, + 0, + -2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_NEG32", + true, + 0xffffffff, + 0xffffffff, + false), + HOWTO (ARM_RVA32, + 0, + 2, + 32, + false, + 0, + complain_overflow_bitfield, + coff_arm_reloc, + "ARM_RVA32", + true, + 0xffffffff, + 0xffffffff, + PCRELOFFSET), + HOWTO (ARM_THUMB9, + 1, + 1, + 8, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_9 , + "ARM_THUMB9", + false, + 0x000000ff, + 0x000000ff, + PCRELOFFSET), + HOWTO (ARM_THUMB12, + 1, + 1, + 11, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_12 , + "ARM_THUMB12", + false, + 0x000007ff, + 0x000007ff, + PCRELOFFSET), + HOWTO (ARM_THUMB23, + 1, + 2, + 22, + true, + 0, + complain_overflow_signed, + coff_thumb_pcrel_23 , + "ARM_THUMB23", + false, + 0x07ff07ff, + 0x07ff07ff, + PCRELOFFSET) #endif /* not ARM_WINCE */ -}; + }; #define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto) #ifdef COFF_WITH_PE +static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); /* Return true if this relocation should appear in the output .reloc section. */ @@ -568,6 +570,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } + /* Used by the assembler. */ static bfd_reloc_status_type @@ -603,7 +606,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, long target = bfd_get_32 (abfd, (bfd_byte *) data + addr); bfd_reloc_status_type flag = bfd_reloc_ok; - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -615,7 +618,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; relocation = (target & 0x00ffffff) << 2; - relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */ + relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -627,7 +630,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, if (relocation & 3) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & 0x02000000) { if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff) @@ -694,7 +697,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, abort (); } - /* If this is an undefined symbol, return error */ + /* If this is an undefined symbol, return error. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined; @@ -723,7 +726,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, abort (); } - relocation = (relocation ^ signbit) - signbit; /* Sign extend */ + relocation = (relocation ^ signbit) - signbit; /* Sign extend. */ relocation += symbol->value; relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; @@ -735,7 +738,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, if (relocation & 1) return bfd_reloc_overflow; - /* Check for overflow */ + /* Check for overflow. */ if (relocation & signbit) { if ((relocation & ~offmsk) != ~offmsk) @@ -769,7 +772,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, Strictly this is only necessary if we are doing a partial relocation. */ reloc_entry->howto = & aoutarm_std_reloc_howto [ARM_26D]; - /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations */ + /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations. */ return flag; } @@ -831,7 +834,8 @@ coff_arm_reloc_type_lookup (abfd, code) case 32: code = BFD_RELOC_32; break; - default: return (CONST struct reloc_howto_struct *) 0; + default: + return (CONST struct reloc_howto_struct *) 0; } switch (code) @@ -872,21 +876,21 @@ coff_arm_reloc_type_lookup (abfd, code) This allows us to store global data here without actually creating any global variables, which is a no-no in the BFD world. */ struct coff_arm_link_hash_table -{ - /* The original coff_link_hash_table structure. MUST be first field. */ - struct coff_link_hash_table root; + { + /* The original coff_link_hash_table structure. MUST be first field. */ + struct coff_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + long int thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + long int arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; - /* Support interworking with old, non-interworking aware ARM code. */ - int support_old_code; + /* Support interworking with old, non-interworking aware ARM code. */ + int support_old_code; }; /* Get the ARM coff linker hash table from a link_info structure. */ @@ -932,9 +936,9 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) + input_section->output_offset + input_section->output_section->vma; - if (coff_data(output_bfd)->pe) - addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; - fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file); + if (coff_data (output_bfd)->pe) + addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; + fwrite (& addr, 1, sizeof (addr), (FILE *) info->base_file); } @@ -964,7 +968,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) moves the computed address into the PC, so it must be the second one in the sequence. The problem, however is that whilst little endian code stores the instructions in HI then LOW order, big endian code does the - reverse. nickc@cygnus.com */ + reverse. nickc@cygnus.com. */ #define LOW_HI_ORDER 0xF800F000 #define HI_LOW_ORDER 0xF000F800 @@ -988,9 +992,8 @@ insert_thumb_branch (br_insn, rel_off) else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER) br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits; else - abort (); /* error - not a valid branch instruction form */ - - /* FIXME: abort is probably not the right call. krk@cygnus.com */ + /* FIXME: the BFD library should never abort - it should return an error status. */ + abort (); /* Error - not a valid branch instruction form. */ return br_insn; } @@ -1306,7 +1309,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC) { - /* Arm code calling a Thumb function */ + /* Arm code calling a Thumb function. */ unsigned long int tmp; long int my_offset; asection * s; @@ -1392,7 +1395,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, } #ifndef ARM_WINCE - /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */ + /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12. */ else if (howto->type == ARM_THUMB23) { if ( h->class == C_EXT @@ -1483,7 +1486,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, s->contents + my_offset + 2); ret_offset = - ((bfd_signed_vma) h_val) /* Address of destination of the stub */ + ((bfd_signed_vma) h_val) /* Address of destination of the stub. */ - ((bfd_signed_vma) (s->output_offset /* Offset from the start of the current section to the start of the stubs. */ + my_offset /* Offset of the start of this stub from the start of the stubs. */ diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index 74c23de..2bba55d 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel 860 COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan <dolan@ssd.intel.com>, October 1995 @@ -36,6 +36,7 @@ static reloc_howto_type *coff_i860_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); +static const bfd_target * i3coff_object_p PARAMS ((bfd *)); #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) /* The page size is a guess based on ELF. */ @@ -342,7 +343,7 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) with and without this section bypassed and then do a binary comparison, the addresses which are different can be looked up in the map. The case in which this section has been bypassed has addresses which correspond - to values I can find in the map */ + to values I can find in the map. */ *addendp -= sym->n_value; } @@ -363,7 +364,7 @@ static const bfd_target * i3coff_object_p(a) bfd *a; { - return coff_object_p(a); + return coff_object_p (a); } const bfd_target diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index bfe3765..3b02400 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -424,16 +424,17 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) } +unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); unsigned int _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) - bfd *abfd; - PTR inp; + bfd * abfd; + PTR inp; int type; int class; int indx ATTRIBUTE_UNUSED; int numaux ATTRIBUTE_UNUSED; - PTR extp; + PTR extp; { union internal_auxent *in = (union internal_auxent *)inp; AUXENT *ext = (AUXENT *)extp; diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index 2d06562..cbaee25 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -1,5 +1,5 @@ /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). - Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Fred Fish (fnf@cygnus.com) @@ -51,6 +51,10 @@ static bfd_reloc_status_type local16_reloc static boolean coff_tic80_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); +static reloc_howto_type * coff_tic80_rtype_to_howto + PARAMS ((bfd *, asection *, struct internal_reloc *, + struct coff_link_hash_entry *, struct internal_syment *, + bfd_vma *)); static reloc_howto_type tic80_howto_table[] = { diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index fb28d79..86d0c58 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -31,6 +31,19 @@ static boolean mn10200_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); static boolean mn10200_elf_symbol_address_p PARAMS ((bfd *, asection *, Elf32_External_Sym *, bfd_vma)); +static bfd_reloc_status_type mn10200_elf_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, + bfd_byte *, bfd_vma, bfd_vma, bfd_vma, + struct bfd_link_info *, asection *, int)); +static boolean mn10200_elf_relocate_section +PARAMS (( bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, + asection **)); +static boolean mn10200_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static bfd_byte * mn10200_elf_get_relocated_section_contents + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean, asymbol **)); /* We have to use RELA instructions since md_apply_fix3 in the assembler does absolutely nothing. */ @@ -214,6 +227,7 @@ mn10200_info_to_howto (abfd, cache_ptr, dst) } /* Perform a relocation as part of a final link. */ + static bfd_reloc_status_type mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, offset, value, diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 8f94bbf..afbd564 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -24,6 +24,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/mn10300.h" +static bfd_reloc_status_type mn10300_elf_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, + bfd_vma, bfd_vma, bfd_vma, struct bfd_link_info *, + asection *, int)); +static boolean mn10300_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean mn10300_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); +static bfd_byte * mn10300_elf_get_relocated_section_contents + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, boolean, asymbol **)); +static int elf_mn10300_mach PARAMS ((flagword)); + +void _bfd_mn10300_elf_final_write_processing PARAMS ((bfd *, boolean)); +boolean _bfd_mn10300_elf_object_p PARAMS ((bfd *)); +boolean _bfd_mn10300_elf_merge_private_bfd_data PARAMS ((bfd *,bfd *)); + struct elf32_mn10300_link_hash_entry { /* The basic elf link hash table entry. */ struct elf_link_hash_entry root; diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index f8f94d6..af27354 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -39,9 +39,9 @@ static bfd_reloc_status_type elf32_arm_final_link_relocate static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct elf_link_hash_entry *find_thumb_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct elf_link_hash_entry *find_arm_glue - PARAMS ((struct bfd_link_info *, CONST char *, bfd *)); + PARAMS ((struct bfd_link_info *, const char *, bfd *)); static void record_arm_to_thumb_glue PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void record_thumb_to_arm_glue @@ -54,7 +54,43 @@ static int elf32_arm_to_thumb_stub static int elf32_thumb_to_arm_stub PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *, bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma)); +static boolean elf32_arm_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static asection * elf32_arm_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_arm_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_arm_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); +static boolean elf32_arm_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static boolean elf32_arm_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_arm_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static boolean elf32_arm_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static struct bfd_hash_entry * elf32_arm_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +#ifdef USE_REL +static void arm_add_to_rel + PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma)); +#endif +boolean bfd_elf32_arm_allocate_interworking_sections + PARAMS ((struct bfd_link_info *)); +boolean bfd_elf32_arm_get_bfd_for_interworking + PARAMS ((bfd *, struct bfd_link_info *)); +boolean bfd_elf32_arm_process_before_allocation + PARAMS ((bfd *, struct bfd_link_info *, int)); #define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) /* The linker script knows the section names for placement. @@ -79,22 +115,22 @@ static int elf32_thumb_to_arm_stub called before the relocation has been set up calls the dynamic linker first. */ static const unsigned long elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe52de004, /* str lr, [sp, #-4]! */ - 0xe59fe010, /* ldr lr, [pc, #16] */ - 0xe08fe00e, /* add lr, pc, lr */ - 0xe5bef008 /* ldr pc, [lr, #8]! */ -}; + { + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe010, /* ldr lr, [pc, #16] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008 /* ldr pc, [lr, #8]! */ + }; /* Subsequent entries in a procedure linkage table look like this. */ static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = -{ - 0xe59fc004, /* ldr ip, [pc, #4] */ - 0xe08fc00c, /* add ip, pc, ip */ - 0xe59cf000, /* ldr pc, [ip] */ - 0x00000000 /* offset to symbol in got */ -}; + { + 0xe59fc004, /* ldr ip, [pc, #4] */ + 0xe08fc00c, /* add ip, pc, ip */ + 0xe59cf000, /* ldr pc, [ip] */ + 0x00000000 /* offset to symbol in got */ + }; /* The ARM linker needs to keep track of the number of relocs that it decides to copy in check_relocs for each symbol. This is so that @@ -105,23 +141,23 @@ static const unsigned long elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ struct elf32_arm_pcrel_relocs_copied -{ - /* Next section. */ - struct elf32_arm_pcrel_relocs_copied * next; - /* A section in dynobj. */ - asection * section; - /* Number of relocs copied in this section. */ - bfd_size_type count; -}; + { + /* Next section. */ + struct elf32_arm_pcrel_relocs_copied * next; + /* A section in dynobj. */ + asection * section; + /* Number of relocs copied in this section. */ + bfd_size_type count; + }; /* Arm ELF linker hash entry. */ struct elf32_arm_link_hash_entry -{ - struct elf_link_hash_entry root; + { + struct elf_link_hash_entry root; - /* Number of PC relative relocs copied for this symbol. */ - struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; -}; + /* Number of PC relative relocs copied for this symbol. */ + struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; + }; /* Declare this now that the above structures are defined. */ static boolean elf32_arm_discard_copies @@ -140,23 +176,23 @@ static boolean elf32_arm_discard_copies /* ARM ELF linker hash table. */ struct elf32_arm_link_hash_table -{ - /* The main hash table. */ - struct elf_link_hash_table root; + { + /* The main hash table. */ + struct elf_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ - long int thumb_glue_size; + /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + long int thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ - long int arm_glue_size; + /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + long int arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ - bfd * bfd_of_glue_owner; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; - /* A boolean indicating whether knowledge of the ARM's pipeline - length should be applied by the linker. */ - int no_pipeline_knowledge; -}; + /* A boolean indicating whether knowledge of the ARM's pipeline + length should be applied by the linker. */ + int no_pipeline_knowledge; + }; /* Create an entry in an ARM ELF linker hash table. */ @@ -221,7 +257,7 @@ elf32_arm_link_hash_table_create (abfd) static struct elf_link_hash_entry * find_thumb_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -256,7 +292,7 @@ find_thumb_glue (link_info, name, input_bfd) static struct elf_link_hash_entry * find_arm_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; - CONST char *name; + const char *name; bfd *input_bfd; { char *tmp_name; @@ -2672,8 +2708,8 @@ elf32_arm_find_nearest_line asection * section; asymbol ** symbols; bfd_vma offset; - CONST char ** filename_ptr; - CONST char ** functionname_ptr; + const char ** filename_ptr; + const char ** functionname_ptr; unsigned int * line_ptr; { boolean found; diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index 913e857..50f7da6 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -1,5 +1,5 @@ /* D10V-specific support for 32-bit ELF - Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -28,171 +28,183 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void d10v_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); - -/* Use REL instead of RELA to save space */ +static asection * elf32_d10v_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_d10v_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_d10v_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean elf32_d10v_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, + asection **)); + +/* Use REL instead of RELA to save space. */ #define USE_REL static reloc_howto_type elf_d10v_howto_table[] = -{ - /* This reloc does nothing. */ - HOWTO (R_D10V_NONE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* An PC Relative 10-bit relocation, shifted by 2 */ - /* right container */ - HOWTO (R_D10V_10_PCREL_R, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_10_PCREL_R", /* name */ - false, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - true), /* pcrel_offset */ - - /* An PC Relative 10-bit relocation, shifted by 2 */ - /* left container */ - HOWTO (R_D10V_10_PCREL_L, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - true, /* pc_relative */ - 15, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_10_PCREL_L", /* name */ - false, /* partial_inplace */ - 0x07f8000, /* src_mask */ - 0x07f8000, /* dst_mask */ - true), /* pcrel_offset */ - - /* A 16 bit absolute relocation */ - HOWTO (R_D10V_16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* An 18 bit absolute relocation, right shifted 2 */ - HOWTO (R_D10V_18, /* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_18", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A relative 18 bit relocation, right shifted by 2 */ - HOWTO (R_D10V_18_PCREL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_18_PCREL", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* A 32 bit absolute relocation */ - HOWTO (R_D10V_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_D10V_32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_D10V_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_D10V_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_D10V_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_D10V_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - -}; + { + /* This reloc does nothing. */ + HOWTO (R_D10V_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* right container */ + HOWTO (R_D10V_10_PCREL_R, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_R", /* name */ + false, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + true), /* pcrel_offset */ + + /* An PC Relative 10-bit relocation, shifted by 2 */ + /* left container */ + HOWTO (R_D10V_10_PCREL_L, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + true, /* pc_relative */ + 15, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_10_PCREL_L", /* name */ + false, /* partial_inplace */ + 0x07f8000, /* src_mask */ + 0x07f8000, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 16 bit absolute relocation */ + HOWTO (R_D10V_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 18 bit absolute relocation, right shifted 2 */ + HOWTO (R_D10V_18, /* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A relative 18 bit relocation, right shifted by 2 */ + HOWTO (R_D10V_18_PCREL, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_18_PCREL", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 32 bit absolute relocation */ + HOWTO (R_D10V_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_D10V_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_D10V_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_D10V_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO (R_D10V_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_D10V_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + }; /* Map BFD reloc types to D10V ELF reloc types. */ struct d10v_reloc_map -{ - bfd_reloc_code_real_type bfd_reloc_val; - unsigned char elf_reloc_val; -}; - - static const struct d10v_reloc_map d10v_reloc_map[] = -{ - { BFD_RELOC_NONE, R_D10V_NONE, }, - { BFD_RELOC_D10V_10_PCREL_R, R_D10V_10_PCREL_R }, - { BFD_RELOC_D10V_10_PCREL_L, R_D10V_10_PCREL_L }, - { BFD_RELOC_16, R_D10V_16 }, - { BFD_RELOC_D10V_18, R_D10V_18 }, - { BFD_RELOC_D10V_18_PCREL, R_D10V_18_PCREL }, - { BFD_RELOC_32, R_D10V_32 }, - { BFD_RELOC_VTABLE_INHERIT, R_D10V_GNU_VTINHERIT }, - { BFD_RELOC_VTABLE_ENTRY, R_D10V_GNU_VTENTRY }, -}; + { + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; + }; + +static const struct d10v_reloc_map d10v_reloc_map[] = + { + { BFD_RELOC_NONE, R_D10V_NONE, }, + { BFD_RELOC_D10V_10_PCREL_R, R_D10V_10_PCREL_R }, + { BFD_RELOC_D10V_10_PCREL_L, R_D10V_10_PCREL_L }, + { BFD_RELOC_16, R_D10V_16 }, + { BFD_RELOC_D10V_18, R_D10V_18 }, + { BFD_RELOC_D10V_18_PCREL, R_D10V_18_PCREL }, + { BFD_RELOC_32, R_D10V_32 }, + { BFD_RELOC_VTABLE_INHERIT, R_D10V_GNU_VTINHERIT }, + { BFD_RELOC_VTABLE_ENTRY, R_D10V_GNU_VTENTRY }, + }; static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup (abfd, code) diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 1b82d9d..c7e4f40 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -58,7 +58,6 @@ static boolean m32r_elf_relocate_section static boolean m32r_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); #endif - static bfd_reloc_status_type m32r_elf_final_sda_base PARAMS ((bfd *, struct bfd_link_info *, const char **, bfd_vma *)); static boolean m32r_elf_object_p @@ -73,6 +72,16 @@ static boolean m32r_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); static boolean m32r_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); +static boolean m32r_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean m32r_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +asection * m32r_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); #define NOP_INSN 0x7000 #define MAKE_PARALLEL(insn) ((insn) | 0x8000) diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index e4b5cd9..a9fec6f 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -48,6 +48,15 @@ static bfd_reloc_status_type mcore_elf_unsupported_reloc static boolean mcore_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static asection * mcore_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean mcore_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean mcore_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); static reloc_howto_type * mcore_elf_howto_table [(int) R_MCORE_max]; diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c index 54fd69c..f0f25fd 100644 --- a/bfd/elf32-openrisc.c +++ b/bfd/elf32-openrisc.c @@ -40,9 +40,16 @@ static bfd_reloc_status_type openrisc_final_link_relocate static boolean openrisc_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static asection *openrisc_elf_gc_mark_hook +static asection * openrisc_elf_gc_mark_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean openrisc_elf_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); +static boolean openrisc_elf_object_p + PARAMS ((bfd *)); +static void openrisc_elf_final_write_processing + PARAMS ((bfd *, boolean)); static reloc_howto_type openrisc_elf_howto_table[] = diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 9869704..11ea3a5 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -72,6 +72,17 @@ static boolean sh_elf_finish_dynamic_symbol Elf_Internal_Sym *)); static boolean sh_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_reloc_status_type sh_elf_reloc_loop + PARAMS ((int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, + bfd_vma, bfd_vma)); +static boolean sh_elf_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static asection * sh_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean sh_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -3641,6 +3652,7 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order, free (sections); return NULL; } + static asection * sh_elf_gc_mark_hook (abfd, info, rel, h, sym) bfd *abfd; diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 3129dd7..9a8d4e2 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -54,6 +54,12 @@ static void elf32_sparc_final_write_processing PARAMS ((bfd *, boolean)); static enum elf_reloc_type_class elf32_sparc_reloc_type_class PARAMS ((int)); +static asection * elf32_sparc_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); +static boolean elf32_sparc_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); /* The relocation "howto" table. */ diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 5e89473..5180736 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -478,7 +478,7 @@ struct v850_elf_reloc_map /* BFD_RELOC_V850_CALLT_16_16_OFFSET is 258, which will not fix in an unsigned char. */ bfd_reloc_code_real_type bfd_reloc_val; - unsigned char elf_reloc_val; + unsigned int elf_reloc_val; }; static const struct v850_elf_reloc_map v850_elf_reloc_map[] = @@ -523,7 +523,7 @@ v850_elf_reloc_type_lookup (abfd, code) for (i = ARRAY_SIZE (v850_elf_reloc_map); i --;) if (v850_elf_reloc_map[i].bfd_reloc_val == code) { - int elf_reloc_val = v850_elf_reloc_map[i].elf_reloc_val; + unsigned int elf_reloc_val = v850_elf_reloc_map[i].elf_reloc_val; BFD_ASSERT (v850_elf_howto_table[elf_reloc_val].type == elf_reloc_val); diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c index ee91e36..73036b7 100644 --- a/bfd/elfarm-nabi.c +++ b/bfd/elfarm-nabi.c @@ -578,6 +578,9 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ +static void elf32_arm_info_to_howto + PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -622,27 +625,27 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE}, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, - {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, - {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, - {BFD_RELOC_32, R_ARM_ABS32}, - {BFD_RELOC_32_PCREL, R_ARM_REL32}, - {BFD_RELOC_8, R_ARM_ABS8}, - {BFD_RELOC_16, R_ARM_ABS16}, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, - {BFD_RELOC_ARM_COPY, R_ARM_COPY}, - {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, - {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, - {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, - {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, - {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, - {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, - {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} -}; + { + {BFD_RELOC_NONE, R_ARM_NONE}, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24}, + {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25}, + {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22}, + {BFD_RELOC_32, R_ARM_ABS32}, + {BFD_RELOC_32_PCREL, R_ARM_REL32}, + {BFD_RELOC_8, R_ARM_ABS8}, + {BFD_RELOC_16, R_ARM_ABS16}, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12}, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5}, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22}, + {BFD_RELOC_ARM_COPY, R_ARM_COPY}, + {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT}, + {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT}, + {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE}, + {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF}, + {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC}, + {BFD_RELOC_ARM_GOT32, R_ARM_GOT32}, + {BFD_RELOC_ARM_PLT32, R_ARM_PLT32} + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) diff --git a/bfd/elfarm-oabi.c b/bfd/elfarm-oabi.c index b4f93f0..25c4d89 100644 --- a/bfd/elfarm-oabi.c +++ b/bfd/elfarm-oabi.c @@ -42,305 +42,310 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION 0 +static reloc_howto_type * find_howto PARAMS ((unsigned int)); +static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); + static reloc_howto_type elf32_arm_howto_table[] = -{ - /* No relocation */ - HOWTO (R_ARM_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_PC24, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PC24", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 32 bit absolute */ - HOWTO (R_ARM_ABS32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* standard 32bit pc-relative reloc */ - HOWTO (R_ARM_REL32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_REL32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 8 bit absolute */ - HOWTO (R_ARM_ABS8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ - - /* 16 bit absolute */ - HOWTO (R_ARM_ABS16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS16", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* 12 bit absolute */ - HOWTO (R_ARM_ABS12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ - 0x000008ff, /* src_mask */ - 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_ABS5, /* type */ - 6, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ - 0x000007e0, /* src_mask */ - 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_THM_PC22, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 23, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ - 0x07ff07ff, /* src_mask */ - 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ - - HOWTO (R_ARM_SBREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_AMP_VCALL9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC11, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* 12 bit pc relative */ - HOWTO (R_ARM_THM_PC9, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_ARM_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_ARM_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_PLT32, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_PLT32", /* name */ - true, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ - - /* XXX - gap in index numbering here. */ - - HOWTO (R_ARM_RREL32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RABS32, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RPC24, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_ARM_RBASE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false) /* pcrel_offset */ -}; + { + /* No relocation. */ + HOWTO (R_ARM_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_PC24, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PC24", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 32 bit absolute. */ + HOWTO (R_ARM_ABS32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Standard 32bit pc-relative reloc. */ + HOWTO (R_ARM_REL32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_REL32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 8 bit absolute. */ + HOWTO (R_ARM_ABS8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS8", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit absolute. */ + HOWTO (R_ARM_ABS16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS16", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* 12 bit absolute. */ + HOWTO (R_ARM_ABS12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_ABS12", /* name */ + false, /* partial_inplace */ + 0x000008ff, /* src_mask */ + 0x000008ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_ABS5, /* type */ + 6, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_ABS5", /* name */ + false, /* partial_inplace */ + 0x000007e0, /* src_mask */ + 0x000007e0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_THM_PC22, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 23, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC22", /* name */ + false, /* partial_inplace */ + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_ARM_SBREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_SBREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_AMP_VCALL9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_AMP_VCALL9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC11, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC11", /* name */ + false, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* 12 bit pc relative. */ + HOWTO (R_ARM_THM_PC9, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_THM_PC9", /* name */ + false, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + true), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_ARM_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_ARM_GNU_VTINHERIT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_ARM_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn, /* special_function */ + "R_ARM_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_PLT32, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_PLT32", /* name */ + true, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* XXX - gap in index numbering here. */ + + HOWTO (R_ARM_RREL32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RREL32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RABS32, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RABS32", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RPC24, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RPC24", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_ARM_RBASE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARM_RBASE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false) /* pcrel_offset */ + }; /* Locate a reloc in the howto table. This function must be used when the entry number is is > R_ARM_GNU_VTINHERIT. */ + static reloc_howto_type * find_howto (r_type) unsigned int r_type; @@ -377,23 +382,23 @@ struct elf32_arm_reloc_map }; static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = -{ - {BFD_RELOC_NONE, R_ARM_NONE }, - {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, - {BFD_RELOC_32, R_ARM_ABS32 }, - {BFD_RELOC_32_PCREL, R_ARM_REL32 }, - {BFD_RELOC_8, R_ARM_ABS8 }, - {BFD_RELOC_16, R_ARM_ABS16 }, - {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, - {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, - {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, - {BFD_RELOC_NONE, R_ARM_SBREL32 }, - {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, - {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, - {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, - {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, - {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } -}; + { + {BFD_RELOC_NONE, R_ARM_NONE }, + {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 }, + {BFD_RELOC_32, R_ARM_ABS32 }, + {BFD_RELOC_32_PCREL, R_ARM_REL32 }, + {BFD_RELOC_8, R_ARM_ABS8 }, + {BFD_RELOC_16, R_ARM_ABS16 }, + {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 }, + {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 }, + {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 }, + {BFD_RELOC_NONE, R_ARM_SBREL32 }, + {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 }, + {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 }, + {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, + {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, + {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } + }; static reloc_howto_type * elf32_arm_reloc_type_lookup (abfd, code) |