diff options
-rw-r--r-- | bfd/ChangeLog | 9 | ||||
-rw-r--r-- | bfd/coff-h8300.c | 23 | ||||
-rw-r--r-- | bfd/coff-h8500.c | 14 | ||||
-rw-r--r-- | bfd/coff-i386.c | 2 | ||||
-rw-r--r-- | bfd/coff-i860.c | 193 | ||||
-rw-r--r-- | bfd/coff-i960.c | 16 | ||||
-rw-r--r-- | bfd/coff-ia64.c | 10 |
7 files changed, 131 insertions, 136 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f16d7e6..90142fd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2000-11-10 Kazu Hirata <kazu@hxi.com> + + * coff-h8300.c: Fix formatting. + * coff-h8500.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + 2000-11-09 Kazu Hirata <kazu@hxi.com> * archive.c: Fix formatting. diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c index acde630..d0287b7 100644 --- a/bfd/coff-h8300.c +++ b/bfd/coff-h8300.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) /* We derive a hash table from the basic BFD hash table to - hold entries in the function vector. Aside from the + hold entries in the function vector. Aside from the info stored by the basic hash table, we need the offset of a particular entry within the hash table as well as the offset where we'll add the next entry. */ @@ -196,7 +196,7 @@ h8300_coff_link_hash_table_create (abfd) We only come here for pcrel stuff and return normally if not an -r link. When doing -r, we can't do any arithmetic for the pcrel stuff, because the code in reloc.c assumes that we can manipulate the targets of - the pcrel branches. This isn't so, since the H8/300 can do relaxing, + the pcrel branches. This isn't so, since the H8/300 can do relaxing, which means that the gap after the instruction may not be enough to contain the offset required for the branch, so we have to use only the addend until the final link. */ @@ -439,7 +439,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) static asection *last_input_section = NULL; static arelent *last_reloc = NULL; - /* The address of the thing to be relocated will have moved back by + /* The address of the thing to be relocated will have moved back by the size of the shrink - but we don't change reloc->address here, since we need it to know where the relocation lives in the source uncooked section. */ @@ -450,7 +450,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) /* Only examine the relocs which might be relaxable. */ switch (reloc->howto->type) - { + { /* This is the 16/24 bit absolute branch which could become an 8 bit pc-relative branch. */ case R_JMP1: @@ -472,7 +472,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ if ((int)gap >= -128 && (int)gap <= 128 ) - { + { /* It's possible we may be able to eliminate this branch entirely; if the previous instruction is a branch around this instruction, and there's no label at this instruction, then we can reverse @@ -482,7 +482,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) bCC lab1 bCC' lab2 jmp lab2 lab1: lab1: - + This saves 4 bytes instead of two, and should be relatively common. */ @@ -535,7 +535,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ if ((int)gap >= -128 && (int)gap <= 128 ) - { + { /* Change the reloc type. */ reloc->howto = howto_table + 15; @@ -690,8 +690,8 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* Get the address of the instruction (not the reloc). */ - dot = (link_order->offset - + dst_address + dot = (link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma + 1); gap = value - dot; @@ -908,7 +908,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, src_address += 2; break; - + /* Similarly for a 24bit absolute that is now 8 bits. */ case R_JMPL2: /* Get the address of the target of this branch. */ @@ -1079,7 +1079,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, } /* This is a jump/call through a function vector, and we're - expected to create the function vector ourselves. + expected to create the function vector ourselves. First look up this symbol in the linker hash table -- we need the derived linker symbol which holds this symbol's index @@ -1279,7 +1279,6 @@ h8300_bfd_link_add_symbols (abfd, info) h = funcvec_hash_lookup (h8300_coff_hash_table (info)->funcvec_hash_table, name, false, false); - /* If this symbol isn't already in the hash table, add it and bump up the size of the hash table. */ if (h == NULL) diff --git a/bfd/coff-h8500.c b/bfd/coff-h8500.c index 22eeaa5..3af7d6a 100644 --- a/bfd/coff-h8500.c +++ b/bfd/coff-h8500.c @@ -45,7 +45,6 @@ static reloc_howto_type r_imm32 = HOWTO (R_H8500_IMM32, 0, 1, 32, false, 0, complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff, 0xffffffff, false); - static reloc_howto_type r_high8 = HOWTO (R_H8500_HIGH8, 0, 1, 8, false, 0, complain_overflow_dont, 0, "r_high8", true, 0x000000ff, 0x000000ff, false); @@ -57,7 +56,6 @@ HOWTO (R_H8500_LOW16, 0, 1, 16, false, 0, static reloc_howto_type r_pcrel8 = HOWTO (R_H8500_PCREL8, 0, 1, 8, true, 0, complain_overflow_signed, 0, "r_pcrel8", true, 0, 0, true); - static reloc_howto_type r_pcrel16 = HOWTO (R_H8500_PCREL16, 0, 1, 16, true, 0, complain_overflow_signed, 0, "r_pcrel16", true, 0, 0, true); @@ -65,10 +63,9 @@ static reloc_howto_type r_high16 = HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0, complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false); - /* Turn a howto into a reloc number */ -static int +static int coff_h8500_select_reloc (howto) reloc_howto_type *howto; { @@ -77,7 +74,6 @@ coff_h8500_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_h8500_select_reloc(howto) - #define BADMAG(x) H8500BADMAG(x) #define H8500 1 /* Customize coffcode.h */ @@ -135,14 +131,11 @@ rtype2howto(internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - /* Perform any necessary magic to the addend in a reloc entry */ - #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) @@ -165,7 +158,6 @@ static void reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } - relent->addend = reloc->r_offset; relent->address -= section->vma; } @@ -217,7 +209,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) (*dst_ptr) += 2; (*src_ptr) += 2; break; - + case R_H8500_HIGH16: bfd_put_16 (in_abfd, (bfd_coff_reloc16_get_value (reloc, link_info, input_section) @@ -247,7 +239,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) } break; - case R_H8500_PCREL8: { bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, @@ -304,7 +295,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 0f23325..83d67c4 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -594,7 +594,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index ab3bb5f..c02acce 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" -static bfd_reloc_status_type coff_i860_reloc +static bfd_reloc_status_type coff_i860_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type *coff_i860_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, @@ -66,7 +66,6 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; - if (bfd_is_com_section (symbol->section)) { /* We are relocating a common symbol. The current value in the @@ -91,7 +90,6 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, diff = reloc_entry->addend; } - #define DOIT(x) \ x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask)) @@ -139,7 +137,7 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #define PCRELOFFSET false #endif -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { EMPTY_HOWTO (0), EMPTY_HOWTO (1), @@ -147,32 +145,32 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (3), EMPTY_HOWTO (4), EMPTY_HOWTO (5), - HOWTO (R_DIR32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_DIR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "dir32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "dir32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* {7}, */ - HOWTO (R_IMAGEBASE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_IMAGEBASE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "rva32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "rva32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ EMPTY_HOWTO (010), EMPTY_HOWTO (011), @@ -181,83 +179,83 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (014), EMPTY_HOWTO (015), EMPTY_HOWTO (016), - HOWTO (R_RELBYTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_RELWORD, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_RELLONG, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRBYTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRWORD, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRLONG, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ PCRELOFFSET) /* pcrel_offset */ }; @@ -335,14 +333,13 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) function will be adding in the final value of the symbol. We need to subtract out the current size in order to get the correct result. */ - - BFD_ASSERT (h != NULL); + BFD_ASSERT (h != NULL); /* I think we *do* want to bypass this. If we don't, I have seen some data parameters get the wrong relcation address. If I link two versions 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 + 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 */ *addendp -= sym->n_value; @@ -351,7 +348,7 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) /* If the output symbol is common (in which case this must be a relocateable link), we need to add in the final size of the common symbol. */ - if (h != NULL && h->root.type == bfd_link_hash_common) + if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; return howto; @@ -400,7 +397,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, i3coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ @@ -419,6 +416,6 @@ const bfd_target BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + COFF_SWAP_TABLE }; diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index 4c37fab..6192247 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -99,7 +99,7 @@ coff_i960_is_local_label_name (abfd, name) #define BAL 0x0b000000 /* Template for 'bal' instruction */ #define BAL_MASK 0x00ffffff -static bfd_reloc_status_type +static bfd_reloc_status_type optcall_callback (abfd, reloc_entry, symbol_in, data, input_section, ignore_bfd, error_message) bfd *abfd; @@ -117,13 +117,13 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, coff_symbol_type *cs = coffsymbol(symbol_in); /* Don't do anything with symbols which aren't tied up yet, - except move the reloc. */ + except move the reloc. */ if (bfd_is_und_section (cs->symbol.section)) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - - /* So the target symbol has to be of coff type, and the symbol + + /* So the target symbol has to be of coff type, and the symbol has to have the correct native information within it */ if ((bfd_asymbol_flavour(&cs->symbol) != bfd_target_coff_flavour) || (cs->native == (combined_entry_type *)NULL)) @@ -138,7 +138,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, } else { - switch (cs->native->u.syment.n_sclass) + switch (cs->native->u.syment.n_sclass) { case C_LEAFSTAT: case C_LEAFEXT: @@ -188,7 +188,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, useful. It was used before this target was converted to use the COFF specific backend linker. */ -static bfd_reloc_status_type +static bfd_reloc_status_type coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; @@ -402,7 +402,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -661,6 +661,6 @@ bfd_getb64, bfd_getb_signed_64, bfd_putb64, BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & icoff_little_vec, - + COFF_SWAP_TABLE }; diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index df867e7..6054e4c 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_PAGE_SIZE 0x1000 -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { {0}, }; @@ -54,15 +54,15 @@ static reloc_howto_type howto_table[] = #ifdef COFF_WITH_PE /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p(abfd, howto) bfd * abfd; reloc_howto_type *howto; { - return 0; /* We don't do relocs for now... */ -} + return 0; /* We don't do relocs for now... */ +} #endif #include "coffcode.h" @@ -174,7 +174,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, ia64coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ |