diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/cpu-sh.c | 12 | ||||
-rw-r--r-- | bfd/elf.c | 4 | ||||
-rw-r--r-- | bfd/elf32-mips.c | 61 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 46 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 4 |
6 files changed, 85 insertions, 50 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 568f2c7..6c8ce49 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2000-12-12 Nick Clifton <nickc@redhat.com> + + * cpu-sh.c: Fix formattng. + * elf.c: Fix formattng. + * elf32-mips.c: Fix formattng. + * elf32-sh.c: Fix formattng. + * elf64-alpha.c: Fix formattng. + 2000-12-09 Nick Clifton <nickc@redhat.com> * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Pass diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c index 64b8e7c..3b903eb 100644 --- a/bfd/cpu-sh.c +++ b/bfd/cpu-sh.c @@ -47,13 +47,13 @@ compatible (a,b) } #endif -#define SH_NEXT &arch_info_struct[0] -#define SH2_NEXT &arch_info_struct[1] -#define SH_DSP_NEXT &arch_info_struct[2] -#define SH3_NEXT &arch_info_struct[3] +#define SH_NEXT &arch_info_struct[0] +#define SH2_NEXT &arch_info_struct[1] +#define SH_DSP_NEXT &arch_info_struct[2] +#define SH3_NEXT &arch_info_struct[3] #define SH3_DSP_NEXT &arch_info_struct[4] -#define SH3E_NEXT &arch_info_struct[5] -#define SH4_NEXT NULL +#define SH3E_NEXT &arch_info_struct[5] +#define SH4_NEXT NULL static const bfd_arch_info_type arch_info_struct[] = { @@ -3307,9 +3307,9 @@ prep_headers (abfd) break; case bfd_arch_i386: if (bfd_get_arch_size (abfd) == 64) - i_ehdrp->e_machine = EM_X86_64; + i_ehdrp->e_machine = EM_X86_64; else - i_ehdrp->e_machine = EM_386; + i_ehdrp->e_machine = EM_386; break; case bfd_arch_ia64: i_ehdrp->e_machine = EM_IA_64; diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index dd3ee18..5bb1e94 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -49,7 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This structure is used to hold .got information when linking. It is stored in the tdata field of the bfd_elf_section_data structure. */ -struct mips_got_info { +struct mips_got_info +{ /* The global symbol in the GOT with the lowest index in the dynamic symbol table. */ struct elf_link_hash_entry *global_gotsym; @@ -64,7 +65,8 @@ struct mips_got_info { /* The MIPS ELF linker needs additional information for each symbol in the global hash table. */ -struct mips_elf_link_hash_entry { +struct mips_elf_link_hash_entry +{ struct elf_link_hash_entry root; /* External symbol information. */ @@ -321,7 +323,8 @@ static bfd *reldyn_sorting_bfd; /* Names of sections which appear in the .dynsym section in an Irix 5 executable. */ -static const char * const mips_elf_dynsym_sec_names[] = { +static const char * const mips_elf_dynsym_sec_names[] = +{ ".text", ".init", ".fini", @@ -345,7 +348,8 @@ static const char * const mips_elf_dynsym_sec_names[] = { /* The names of the runtime procedure table symbols used on Irix 5. */ -static const char * const mips_elf_dynsym_rtproc_names[] = { +static const char * const mips_elf_dynsym_rtproc_names[] = +{ "_procedure_table", "_procedure_string_table", "_procedure_table_size", @@ -355,7 +359,8 @@ static const char * const mips_elf_dynsym_rtproc_names[] = { /* These structures are used to generate the .compact_rel section on Irix 5. */ -typedef struct { +typedef struct +{ unsigned long id1; /* Always one? */ unsigned long num; /* Number of compact relocation entries. */ unsigned long id2; /* Always two? */ @@ -364,7 +369,8 @@ typedef struct { unsigned long reserved1; /* Zero? */ } Elf32_compact_rel; -typedef struct { +typedef struct +{ bfd_byte id1[4]; bfd_byte num[4]; bfd_byte id2[4]; @@ -373,7 +379,8 @@ typedef struct { bfd_byte reserved1[4]; } Elf32_External_compact_rel; -typedef struct { +typedef struct +{ unsigned int ctype : 1; /* 1: long 0: short format. See below. */ unsigned int rtype : 4; /* Relocation types. See below. */ unsigned int dist2to : 8; @@ -382,7 +389,8 @@ typedef struct { unsigned long vaddr; /* VADDR to be relocated. */ } Elf32_crinfo; -typedef struct { +typedef struct +{ unsigned int ctype : 1; /* 1: long 0: short format. See below. */ unsigned int rtype : 4; /* Relocation types. See below. */ unsigned int dist2to : 8; @@ -390,13 +398,15 @@ typedef struct { unsigned long konst; /* KONST field. See below. */ } Elf32_crinfo2; -typedef struct { +typedef struct +{ bfd_byte info[4]; bfd_byte konst[4]; bfd_byte vaddr[4]; } Elf32_External_crinfo; -typedef struct { +typedef struct +{ bfd_byte info[4]; bfd_byte konst[4]; } Elf32_External_crinfo2; @@ -449,7 +459,8 @@ static void bfd_elf32_swap_crinfo_out from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) -static reloc_howto_type elf_mips_howto_table[] = { +static reloc_howto_type elf_mips_howto_table[] = +{ /* No relocation. */ HOWTO (R_MIPS_NONE, /* type */ 0, /* rightshift */ @@ -1067,7 +1078,8 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto = reloc. This extension permits gcc to output the HI and LO relocs itself. */ -struct mips_hi16 { +struct mips_hi16 +{ struct mips_hi16 *next; bfd_byte *addr; bfd_vma addend; @@ -1924,7 +1936,8 @@ struct elf_reloc_map { enum elf_mips_reloc_type elf_reloc_val; }; -static CONST struct elf_reloc_map mips_reloc_map[] = { +static CONST struct elf_reloc_map mips_reloc_map[] = +{ { BFD_RELOC_NONE, R_MIPS_NONE, }, { BFD_RELOC_16, R_MIPS_16 }, { BFD_RELOC_32, R_MIPS_32 }, @@ -3491,7 +3504,8 @@ _bfd_mips_elf_modify_segment_map (abfd) if (m != NULL && m->count == 1 && strcmp (m->sections[0]->name, ".dynamic") == 0) { - static const char *sec_names[] = { + static const char *sec_names[] = + { ".dynamic", ".dynstr", ".dynsym", ".hash" }; bfd_vma low, high; @@ -3710,7 +3724,8 @@ mips_elf_is_local_label_name (abfd, name) /* MIPS ELF uses a special find_nearest_line routine in order the handle the ECOFF debugging information. */ -struct mips_elf_find_line { +struct mips_elf_find_line +{ struct ecoff_debug_info d; struct ecoff_find_line i; }; @@ -3863,7 +3878,8 @@ _bfd_mips_elf_find_nearest_line (abfd, section, symbols, offset, filename_ptr, /* MIPS ELF linker hash table. */ -struct mips_elf_link_hash_table { +struct mips_elf_link_hash_table +{ struct elf_link_hash_table root; #if 0 /* We no longer use this. */ @@ -4157,7 +4173,8 @@ _bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) /* Structure used to pass information to mips_elf_output_extsym. */ -struct extsym_info { +struct extsym_info +{ bfd *abfd; struct bfd_link_info *info; struct ecoff_debug_info *debug; @@ -4532,11 +4549,13 @@ _bfd_mips_elf_final_link (abfd, info) EXTR esym; bfd_vma last; unsigned int i; - static const char * const name[] = { + static const char * const name[] = + { ".text", ".init", ".fini", ".data", ".rodata", ".sdata", ".sbss", ".bss" }; - static const int sc[] = { + static const int sc[] = + { scText, scInit, scFini, scData, scRData, scSData, scSBss, scBss }; @@ -5455,7 +5474,8 @@ mips_elf_record_global_got_symbol (h, info, g) /* This structure is passed to mips_elf_sort_hash_table_f when sorting the dynamic symbols. */ -struct mips_elf_hash_sort_data { +struct mips_elf_hash_sort_data +{ /* The symbol in the global GOT with the lowest dynamic symbol table index. */ struct elf_link_hash_entry *low; @@ -6610,7 +6630,6 @@ mips_elf_perform_relocation (info, howto, relocation, value, value = (((value & 0x1f0000) << 5) | ((value & 0x3e00000) >> 5) | (value & 0xffff)); - } else if (r_type == R_MIPS16_GPREL) { diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 61df1f7..1648b71 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -77,7 +77,8 @@ static boolean sh_elf_finish_dynamic_sections #define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1" -static reloc_howto_type sh_elf_howto_table[] = { +static reloc_howto_type sh_elf_howto_table[] = +{ /* No relocation. */ HOWTO (R_SH_NONE, /* type */ 0, /* rightshift */ @@ -911,14 +912,16 @@ sh_elf_ignore_reloc (abfd, reloc_entry, symbol, data, input_section, /* This structure is used to map BFD reloc codes to SH ELF relocs. */ -struct elf_reloc_map { +struct elf_reloc_map +{ bfd_reloc_code_real_type bfd_reloc_val; unsigned char elf_reloc_val; }; /* An array mapping BFD reloc codes to SH ELF relocs. */ -static const struct elf_reloc_map sh_reloc_map[] = { +static const struct elf_reloc_map sh_reloc_map[] = +{ { BFD_RELOC_NONE, R_SH_NONE }, { BFD_RELOC_32, R_SH_DIR32 }, { BFD_RELOC_CTOR, R_SH_DIR32 }, @@ -2087,7 +2090,8 @@ sh_elf_swap_insns (abfd, sec, relocs, contents, addr) /* First entry in an absolute procedure linkage table look like this. */ -static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = +{ 0xd0, 0x04, /* mov.l 1f,r0 */ 0xd2, 0x05, /* mov.l 2f,r2 */ 0x60, 0x02, /* mov.l @r0,r0 */ @@ -2102,7 +2106,8 @@ static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] = { 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */ }; -static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = +{ 0x04, 0xd0, /* mov.l 1f,r0 */ 0x05, 0xd2, /* mov.l 2f,r2 */ 0x02, 0x60, /* mov.l @r0,r0 */ @@ -2120,7 +2125,8 @@ static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] = { /* Sebsequent entries in an absolute procedure linkage table look like this. */ -static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = +{ 0xd0, 0x04, /* mov.l 1f,r0 */ 0x60, 0x02, /* mov.l @r0,r0 */ 0xd2, 0x02, /* mov.l 0f,r2 */ @@ -2134,7 +2140,8 @@ static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] = { 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */ }; -static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = +{ 0x04, 0xd0, /* mov.l 1f,r0 */ 0x02, 0x60, /* mov.l @r0,r0 */ 0x02, 0xd2, /* mov.l 0f,r2 */ @@ -2150,7 +2157,8 @@ static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] = { /* Entries in a PIC procedure linkage table look like this. */ -static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = +{ 0xd0, 0x04, /* mov.l 1f,r0 */ 0x00, 0xce, /* mov.l @(r0,r12),r0 */ 0x40, 0x2b, /* jmp @r0 */ @@ -2165,7 +2173,8 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] = { 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */ }; -static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = { +static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] = +{ 0x04, 0xd0, /* mov.l 1f,r0 */ 0xce, 0x00, /* mov.l @(r0,r12),r0 */ 0x2b, 0x40, /* jmp @r0 */ @@ -2214,7 +2223,8 @@ static const bfd_byte *elf_sh_pic_plt_entry; /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ -struct elf_sh_pcrel_relocs_copied { +struct elf_sh_pcrel_relocs_copied +{ /* Next section. */ struct elf_sh_pcrel_relocs_copied *next; /* A section in dynobj. */ @@ -2225,7 +2235,8 @@ struct elf_sh_pcrel_relocs_copied { /* sh ELF linker hash entry. */ -struct elf_sh_link_hash_entry { +struct elf_sh_link_hash_entry +{ struct elf_link_hash_entry root; /* Number of PC relative relocs copied for this symbol. */ @@ -2234,7 +2245,8 @@ struct elf_sh_link_hash_entry { /* sh ELF linker hash table. */ -struct elf_sh_link_hash_table { +struct elf_sh_link_hash_table +{ struct elf_link_hash_table root; }; @@ -3524,9 +3536,7 @@ sh_elf_gc_mark_hook (abfd, info, rel, h, sym) && ELF_ST_BIND (sym->st_info) != STB_LOCAL) && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) && sym->st_shndx != SHN_COMMON)) - { - return bfd_section_from_elf_index (abfd, sym->st_shndx); - } + return bfd_section_from_elf_index (abfd, sym->st_shndx); } return NULL; } @@ -3895,10 +3905,10 @@ sh_elf_set_private_flags (abfd, flags) static boolean sh_elf_copy_private_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; + bfd * ibfd; + bfd * obfd; { - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index f355427..ce63cc7 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -4741,9 +4741,7 @@ const struct elf_size_info alpha_elf_size_info = #define elf_backend_size_info \ alpha_elf_size_info -/* - * A few constants that determine how the .plt section is set up. - */ +/* A few constants that determine how the .plt section is set up. */ #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 |