From 7e0ce9b7e78a28c542e2eed4af570d35075363b7 Mon Sep 17 00:00:00 2001 From: kazu Date: Wed, 3 Jan 2001 22:53:38 +0000 Subject: [PATCH] 2001-01-03 Kazu Hirata * ecoffswap.h: Fix formatting. * elf-bfd.h: Likewise. * elfarm-nabi.c: Likewise. * elfarm-oabi.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * elfxx-target.h: Likewise. --- bfd/ChangeLog | 12 +++++- bfd/ecoffswap.h | 72 ++++++++++++++++---------------- bfd/elf-bfd.h | 18 ++++---- bfd/elfarm-nabi.c | 41 +++++++++--------- bfd/elfarm-oabi.c | 10 ++--- bfd/elfcode.h | 49 ++++++++++------------ bfd/elfcore.h | 35 +++++++--------- bfd/elflink.c | 8 ++-- bfd/elflink.h | 119 ++++++++++++++++++++++++++--------------------------- bfd/elfxx-ia64.c | 44 ++++++++++---------- bfd/elfxx-target.h | 10 ++--- 11 files changed, 208 insertions(+), 210 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1ea669ce71..79df9d5472 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,16 @@ 2001-01-03 Kazu Hirata - * libbfd.c: Fix formatting. + * ecoffswap.h: Fix formatting. + * elf-bfd.h: Likewise. + * elfarm-nabi.c: Likewise. + * elfarm-oabi.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-target.h: Likewise. + * libbfd.c: Likewise * linker.c: Likewise. * lynx-core.c: Likewise. diff --git a/bfd/ecoffswap.h b/bfd/ecoffswap.h index efafe91254..70d548da77 100644 --- a/bfd/ecoffswap.h +++ b/bfd/ecoffswap.h @@ -131,7 +131,7 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -176,7 +176,7 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -191,7 +191,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) struct fdr_ext ext[1]; *ext = *(struct fdr_ext *) ext_copy; - + intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->f_adr); intern->rss = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rss); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) @@ -219,7 +219,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase); intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG) >> FDR_BITS1_LANG_SH_BIG; @@ -244,7 +244,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -260,7 +260,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) FDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->f_adr); bfd_h_put_32 (abfd, intern->rss, (bfd_byte *)ext->f_rss); bfd_h_put_32 (abfd, intern->issBase, (bfd_byte *)ext->f_issBase); @@ -284,7 +284,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase); bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG) & FDR_BITS1_LANG_BIG) @@ -312,7 +312,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -373,11 +373,11 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) << PDR_BITS2_RESERVED_SH_LEFT_LITTLE)); } intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -393,7 +393,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); @@ -434,17 +434,17 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) & PDR_BITS2_RESERVED_LITTLE); } bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #else /* MPW_C */ /* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't - corrupt itself and then freak out. */ + corrupt itself and then freak out. */ /* Swap in the procedure descriptor record. */ static void @@ -456,7 +456,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) struct pdr_ext ext[1]; *ext = *(struct pdr_ext *) ext_copy; - + intern->adr = ecoff_get_off (abfd, (bfd_byte *)ext->p_adr); intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym); intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline); @@ -477,7 +477,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -493,7 +493,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + ecoff_put_off (abfd, intern->adr, (bfd_byte *)ext->p_adr); bfd_h_put_32 (abfd, intern->isym, (bfd_byte *)ext->p_isym); bfd_h_put_32 (abfd, intern->iline, (bfd_byte *)ext->p_iline); @@ -511,7 +511,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #endif /* MPW_C */ @@ -527,11 +527,11 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) struct sym_ext ext[1]; *ext = *(struct sym_ext *) ext_copy; - + intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss); intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG) >> SYM_BITS1_ST_SH_BIG; @@ -561,7 +561,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -577,11 +577,11 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) SYMR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - + bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss); ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG) & SYM_BITS1_ST_BIG) @@ -610,7 +610,7 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -625,8 +625,8 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) struct ext_ext ext[1]; *ext = *(struct ext_ext *) ext_copy; - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG); intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG); @@ -649,7 +649,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -665,8 +665,8 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) EXTR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_BIG : 0) | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_BIG : 0) @@ -698,7 +698,7 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -716,7 +716,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -734,7 +734,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -775,7 +775,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -814,7 +814,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -835,7 +835,7 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -857,6 +857,6 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index d88e4a3947..4a36629fa1 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -208,7 +208,7 @@ struct elf_link_local_dynamic_entry /* The index in the outgoing dynamic symbol table. */ long dynindx; - + /* A copy of the input symbol. */ Elf_Internal_Sym isym; }; @@ -375,7 +375,7 @@ struct elf_backend_data unsigned int)); /* A function to set the type of the info field. Processor-specific - types should be handled here. */ + types should be handled here. */ int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int)); /* A function to do additional processing on the ELF section header @@ -397,7 +397,7 @@ struct elf_backend_data Elf32_Internal_Shdr *)); /* A function to handle unusual program segment types when creating BFD - sections from ELF program segments. */ + sections from ELF program segments. */ boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); @@ -796,14 +796,14 @@ struct elf_obj_tdata file_ptr next_file_pos; #if 0 /* we don't need these inside bfd anymore, and I think - these weren't used outside bfd. */ + these weren't used outside bfd. */ void *prstatus; /* The raw /proc prstatus structure */ void *prpsinfo; /* The raw /proc prpsinfo structure */ #endif bfd_vma gp; /* The gp value (MIPS only, for now) */ unsigned int gp_size; /* The gp size (MIPS only, for now) */ - /* Information grabbed from an elf core file. */ + /* Information grabbed from an elf core file. */ int core_signal; int core_pid; int core_lwpid; @@ -825,7 +825,7 @@ struct elf_obj_tdata document the intent of any particular piece of code. The field should be used as a count until size_dynamic_sections, at which point the contents of the .got is fixed. Afterward, if an entry - is -1, then the symbol does not require a global offset table entry. */ + is -1, then the symbol does not require a global offset table entry. */ union { bfd_signed_vma *refcounts; @@ -851,7 +851,7 @@ struct elf_obj_tdata ELF emulation code, we need to add the shared object to the DT_NEEDED list of the resulting binary to indicate the dependency as if the -l option is passed to the linker. This field holds the - name of the loaded shared object. */ + name of the loaded shared object. */ const char *dt_soname; /* Irix 5 often screws up the symbol table, sorting local symbols @@ -873,10 +873,10 @@ struct elf_obj_tdata find_nearest_line. */ struct mips_elf_find_line *find_line_info; - /* A place to stash dwarf1 info for this bfd. */ + /* A place to stash dwarf1 info for this bfd. */ struct dwarf1_debug *dwarf1_find_line_info; - /* A place to stash dwarf2 info for this bfd. */ + /* A place to stash dwarf2 info for this bfd. */ PTR dwarf2_find_line_info; /* An array of stub sections indexed by symbol number, used by the diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c index 460b59c947..55e1f03d91 100644 --- a/bfd/elfarm-nabi.c +++ b/bfd/elfarm-nabi.c @@ -44,8 +44,8 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. - R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO - in that slot. */ + R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO + in that slot. */ static reloc_howto_type elf32_arm_howto_table[] = { @@ -280,7 +280,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* BLX instruction for the Thumb. */ HOWTO (R_ARM_THM_XPC22, /* type */ 2, /* rightshift */ @@ -295,7 +295,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x07ff07ff, /* src_mask */ 0x07ff07ff, /* dst_mask */ true), /* pcrel_offset */ - + /* These next three relocs are not defined, but we need to fill the space. */ HOWTO (R_ARM_NONE, /* type */ @@ -341,7 +341,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* Relocs used in ARM Linux */ - + HOWTO (R_ARM_COPY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -369,7 +369,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -383,7 +383,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_RELATIVE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -397,7 +397,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -411,7 +411,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTPC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -425,7 +425,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + HOWTO (R_ARM_GOT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -439,7 +439,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -453,8 +453,8 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - - /* End of relocs used in ARM Linux */ + + /* End of relocs used in ARM Linux */ HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -578,7 +578,6 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ - static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -586,7 +585,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) Elf32_Internal_Rel * elf_reloc; { unsigned int r_type; - + r_type = ELF32_R_TYPE (elf_reloc->r_info); switch (r_type) @@ -594,19 +593,19 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) case R_ARM_GNU_VTINHERIT: bfd_reloc->howto = & elf32_arm_vtinherit_howto; break; - + case R_ARM_GNU_VTENTRY: bfd_reloc->howto = & elf32_arm_vtentry_howto; break; - + case R_ARM_THM_PC11: bfd_reloc->howto = & elf32_arm_thm_pc11_howto; break; - + case R_ARM_THM_PC9: bfd_reloc->howto = & elf32_arm_thm_pc9_howto; break; - + default: if (r_type >= NUM_ELEM (elf32_arm_howto_table)) bfd_reloc->howto = NULL; @@ -615,7 +614,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) break; } } - + struct elf32_arm_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; @@ -670,7 +669,7 @@ elf32_arm_reloc_type_lookup (abfd, code) for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++) if (elf32_arm_reloc_map[i].bfd_reloc_val == code) return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val]; - + return NULL; } } diff --git a/bfd/elfarm-oabi.c b/bfd/elfarm-oabi.c index 833f509cb7..e49ea9c40d 100644 --- a/bfd/elfarm-oabi.c +++ b/bfd/elfarm-oabi.c @@ -265,7 +265,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* XXX - gap in index numbering here. */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -279,7 +279,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* XXX - gap in index numbering here. */ HOWTO (R_ARM_RREL32, /* type */ @@ -346,7 +346,7 @@ find_howto (r_type) unsigned int r_type; { int i; - + for (i = NUM_ELEM (elf32_arm_howto_table); i--;) if (elf32_arm_howto_table [i].type == r_type) return elf32_arm_howto_table + i; @@ -390,7 +390,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = {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_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } }; @@ -408,7 +408,7 @@ elf32_arm_reloc_type_lookup (abfd, code) if (code == BFD_RELOC_ARM_PLT32) return find_howto (R_ARM_PLT32); - + return NULL; } diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 40bbaf52ef..1a5f63a6b1 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -197,7 +197,7 @@ static char *elf_symbol_flags PARAMS ((flagword)); #endif /* Translate an ELF symbol in external format into an ELF symbol in internal - format. */ + format. */ void elf_swap_symbol_in (abfd, src, dst) @@ -219,7 +219,7 @@ elf_swap_symbol_in (abfd, src, dst) } /* Translate an ELF symbol in internal format into an ELF symbol in external - format. */ + format. */ void elf_swap_symbol_out (abfd, src, cdst) @@ -236,9 +236,8 @@ elf_swap_symbol_out (abfd, src, cdst) bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx); } - /* Translate an ELF file header in external format into an ELF file header in - internal format. */ + internal format. */ static void elf_swap_ehdr_in (abfd, src, dst) @@ -267,7 +266,7 @@ elf_swap_ehdr_in (abfd, src, dst) } /* Translate an ELF file header in internal format into an ELF file header in - external format. */ + external format. */ static void elf_swap_ehdr_out (abfd, src, dst) @@ -277,7 +276,7 @@ elf_swap_ehdr_out (abfd, src, dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; memcpy (dst->e_ident, src->e_ident, EI_NIDENT); - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_16 (abfd, src->e_type, dst->e_type); bfd_h_put_16 (abfd, src->e_machine, dst->e_machine); bfd_h_put_32 (abfd, src->e_version, dst->e_version); @@ -296,9 +295,8 @@ elf_swap_ehdr_out (abfd, src, dst) bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx); } - /* Translate an ELF section header table entry in external format into an - ELF section header table entry in internal format. */ + ELF section header table entry in internal format. */ static void elf_swap_shdr_in (abfd, src, dst) @@ -326,7 +324,7 @@ elf_swap_shdr_in (abfd, src, dst) } /* Translate an ELF section header table entry in internal format into an - ELF section header table entry in external format. */ + ELF section header table entry in external format. */ static void elf_swap_shdr_out (abfd, src, dst) @@ -334,7 +332,7 @@ elf_swap_shdr_out (abfd, src, dst) const Elf_Internal_Shdr *src; Elf_External_Shdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_32 (abfd, src->sh_name, dst->sh_name); bfd_h_put_32 (abfd, src->sh_type, dst->sh_type); put_word (abfd, src->sh_flags, dst->sh_flags); @@ -347,9 +345,8 @@ elf_swap_shdr_out (abfd, src, dst) put_word (abfd, src->sh_entsize, dst->sh_entsize); } - /* Translate an ELF program header table entry in external format into an - ELF program header table entry in internal format. */ + ELF program header table entry in internal format. */ void elf_swap_phdr_in (abfd, src, dst) @@ -383,7 +380,7 @@ elf_swap_phdr_out (abfd, src, dst) const Elf_Internal_Phdr *src; Elf_External_Phdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* note that all elements of dst are *arrays of unsigned char* already... */ bfd_h_put_32 (abfd, src->p_type, dst->p_type); put_word (abfd, src->p_offset, dst->p_offset); put_word (abfd, src->p_vaddr, dst->p_vaddr); @@ -394,7 +391,7 @@ elf_swap_phdr_out (abfd, src, dst) put_word (abfd, src->p_align, dst->p_align); } -/* Translate an ELF reloc from external format to internal format. */ +/* Translate an ELF reloc from external format to internal format. */ INLINE void elf_swap_reloc_in (abfd, src, dst) bfd *abfd; @@ -416,7 +413,7 @@ elf_swap_reloca_in (abfd, src, dst) dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend); } -/* Translate an ELF reloc from internal format to external format. */ +/* Translate an ELF reloc from internal format to external format. */ INLINE void elf_swap_reloc_out (abfd, src, dst) bfd *abfd; @@ -464,7 +461,6 @@ elf_swap_dyn_out (abfd, src, p) /* ELF .o/exec file reading */ - /* Begin processing a given object. First we validate the file by reading in the ELF header and checking @@ -526,7 +522,7 @@ elf_object_p (abfd) make use of. The magic number must match, the address size ('class') and byte-swapping must match our XVEC entry, and it must have a section header table (FIXME: See comments re sections at top of this - file). */ + file). */ if ((elf_file_p (&x_ehdr) == false) || (x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) || @@ -569,13 +565,13 @@ elf_object_p (abfd) if (i_ehdrp->e_type == ET_CORE) goto got_wrong_format_error; - /* If there is no section header table, we're hosed. */ + /* If there is no section header table, we're hosed. */ if (i_ehdrp->e_shoff == 0) goto got_wrong_format_error; /* As a simple sanity check, verify that the what BFD thinks is the size of each section header table entry actually matches the size - recorded in the file. */ + recorded in the file. */ if (i_ehdrp->e_shentsize != sizeof (x_shdr)) goto got_wrong_format_error; @@ -629,7 +625,7 @@ elf_object_p (abfd) goto got_no_match; } - /* Remember the entry point specified in the ELF file header. */ + /* Remember the entry point specified in the ELF file header. */ bfd_set_start_address (abfd, i_ehdrp->e_entry); /* Allocate space for a copy of the section header table in @@ -695,7 +691,7 @@ elf_object_p (abfd) } /* Read in the string table containing the names of the sections. We - will need the base pointer to this table later. */ + will need the base pointer to this table later. */ /* We read this inline now, so that we don't have to go through bfd_section_from_shdr with it (since this particular strtab is used to find all of the ELF section names.) */ @@ -822,7 +818,7 @@ elf_write_relocs (abfd, sec, data) SHT_REL section. */ abort (); - /* orelocation has the data, reloc_count has the count... */ + /* orelocation has the data, reloc_count has the count... */ if (use_rela_p) { outbound_relocas = (Elf_External_Rela *) rela_hdr->contents; @@ -968,7 +964,7 @@ elf_write_shdrs_and_ehdr (abfd) i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); - /* swap the header before spitting it out... */ + /* swap the header before spitting it out... */ #if DEBUG & 1 elf_debug_file (i_ehdrp); @@ -979,7 +975,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (x_ehdr))) return false; - /* at this point we've concocted all the ELF sections... */ + /* at this point we've concocted all the ELF sections... */ x_shdrp = (Elf_External_Shdr *) bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum)); if (!x_shdrp) @@ -997,7 +993,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (*x_shdrp) * i_ehdrp->e_shnum)) return false; - /* need to dump the string table too... */ + /* need to dump the string table too... */ return true; } @@ -1025,7 +1021,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) based on a one-to-one mapping of the ELF symbols to canonical symbols. We actually use all the ELF symbols, so there will be no space left over at the end. When we have all the symbols, we - build the caller's pointer vector. */ + build the caller's pointer vector. */ if (! dynamic) { @@ -1421,7 +1417,6 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) symbols, dynamic)) return false; - asect->relocation = relents; return true; } diff --git a/bfd/elfcore.h b/bfd/elfcore.h index f04c1d2a3b..2c99e8b454 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - char* elf_core_file_failing_command (abfd) bfd *abfd; @@ -32,7 +31,6 @@ elf_core_file_failing_signal (abfd) return elf_tdata (abfd)->core_signal; } - boolean elf_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; @@ -40,7 +38,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) { char* corename; - /* xvecs must match if both are ELF files for the same target. */ + /* xvecs must match if both are ELF files for the same target. */ if (core_bfd->xvec != exec_bfd->xvec) { @@ -48,7 +46,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return false; } - /* See if the name in the corefile matches the executable name. */ + /* See if the name in the corefile matches the executable name. */ corename = elf_tdata (core_bfd)->core_program; if (corename != NULL) @@ -63,7 +61,6 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return true; } - /* Core files are simply standard ELF formatted files that partition the file using the execution view of the file (program header table) rather than the linking view. In fact, there is no section header @@ -97,17 +94,17 @@ elf_core_file_p (abfd) return NULL; } - /* Check the magic number. */ + /* Check the magic number. */ if (elf_file_p (&x_ehdr) == false) goto wrong; /* FIXME: Check EI_VERSION here ! */ - /* Check the address size ("class"). */ + /* Check the address size ("class"). */ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS) goto wrong; - /* Check the byteorder. */ + /* Check the byteorder. */ switch (x_ehdr.e_ident[EI_DATA]) { case ELFDATA2MSB: /* Big-endian */ @@ -122,14 +119,14 @@ elf_core_file_p (abfd) goto wrong; } - /* Give abfd an elf_obj_tdata. */ - new_tdata = + /* Give abfd an elf_obj_tdata. */ + new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); if (new_tdata == NULL) return NULL; - elf_tdata (abfd) = new_tdata; + elf_tdata (abfd) = new_tdata; - /* Swap in the rest of the header, now that we have the byte order. */ + /* Swap in the rest of the header, now that we have the byte order. */ i_ehdrp = elf_elfheader (abfd); elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp); @@ -173,7 +170,7 @@ elf_core_file_p (abfd) } /* If there is no program header, or the type is not a core file, then - we are hosed. */ + we are hosed. */ if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE) goto wrong; @@ -185,8 +182,8 @@ elf_core_file_p (abfd) /* Move to the start of the program headers. */ if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0) goto wrong; - - /* Allocate space for the program headers. */ + + /* Allocate space for the program headers. */ i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum); if (!i_phdrp) @@ -194,7 +191,7 @@ elf_core_file_p (abfd) elf_tdata (abfd)->phdr = i_phdrp; - /* Read and convert to internal form. */ + /* Read and convert to internal form. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { Elf_External_Phdr x_phdr; @@ -205,14 +202,14 @@ elf_core_file_p (abfd) elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex); } - /* Process each program header. */ + /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex)) goto fail; } - /* Set the machine architecture. */ + /* Set the machine architecture. */ if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0)) { /* It's OK if this fails for the generic target. */ @@ -220,7 +217,7 @@ elf_core_file_p (abfd) goto fail; } - /* Save the entry point from the ELF header. */ + /* Save the entry point from the ELF header. */ bfd_get_start_address (abfd) = i_ehdrp->e_entry; /* Let the backend double check the format and override global diff --git a/bfd/elflink.c b/bfd/elflink.c index e9fb64d047..1aa2db044b 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -163,7 +163,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) return false; } - s = bfd_make_section (abfd, + s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) @@ -199,9 +199,9 @@ _bfd_elf_create_dynamic_sections (abfd, info) copy relocs. */ if (! info->shared) { - s = bfd_make_section (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss")); + s = bfd_make_section (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) diff --git a/bfd/elflink.h b/bfd/elflink.h index b3e1bbc6fc..6606bf2ae7 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -50,14 +50,14 @@ static boolean elf_link_assign_sym_version PARAMS ((struct elf_link_hash_entry *, PTR)); static boolean elf_collect_hash_codes PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_link_read_relocs_from_section +static boolean elf_link_read_relocs_from_section PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *)); static void elf_link_output_relocs PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); static boolean elf_link_size_reloc_section PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -static void elf_link_adjust_relocs - PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, +static void elf_link_adjust_relocs + PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int, struct elf_link_hash_entry **)); /* Given an ELF BFD, add symbols to the global hash table as @@ -94,7 +94,7 @@ is_global_symbol_definition (abfd, sym) /* If the section is undefined, then so is the symbol. */ if (sym->st_shndx == SHN_UNDEF) return false; - + /* If the symbol is defined in the common section, then it is a common definition and so does not count. */ if (sym->st_shndx == SHN_COMMON) @@ -104,18 +104,17 @@ is_global_symbol_definition (abfd, sym) must rely upon the backend to tell us what it is. */ if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS) /* FIXME - this function is not coded yet: - + return _bfd_is_global_symbol_definition (abfd, sym); - + Instead for now assume that the definition is not global, Even if this is wrong, at least the linker will behave in the same way that it used to do. */ return false; - + return true; } - /* Search the symbol table of the archive element of the archive ABFD whoes archove map contains a mention of SYMDEF, and determine if the symbol is defined in this element. */ @@ -132,7 +131,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) size_t extsymcount; size_t extsymoff; boolean result = false; - + abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); if (abfd == (bfd *) NULL) return false; @@ -146,7 +145,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) (re)include this element. */ if (abfd->archive_pass) return false; - + /* Select the appropriate symbol table. */ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) hdr = &elf_tdata (abfd)->symtab_hdr; @@ -208,7 +207,7 @@ elf_link_is_defined_archive_symbol (abfd, symdef) } free (buf); - + return result; } @@ -628,7 +627,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, /* It's OK to change the type if either the existing symbol or the new symbol is weak unless it comes from a DT_NEEDED entry of a shared object, in which case, the DT_NEEDED entry may not be - required at the run time. */ + required at the run time. */ if ((! dt_needed && h->root.type == bfd_link_hash_defweak) || h->root.type == bfd_link_hash_undefweak @@ -684,7 +683,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, We prefer a non-weak definition in a shared library to a weak definition in the executable unless it comes from a DT_NEEDED entry of a shared object, in which case, the DT_NEEDED entry - may not be required at the run time. */ + may not be required at the run time. */ if (newdyn && newdef @@ -692,7 +691,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, || (h->root.type == bfd_link_hash_common && (bind == STB_WEAK || ELF_ST_TYPE (sym->st_info) == STT_FUNC))) - && (h->root.type != bfd_link_hash_defweak + && (h->root.type != bfd_link_hash_defweak || dt_needed || bind == STB_WEAK)) { @@ -830,7 +829,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, followed by a non-weak definition in a shared object. In this case, we prefer the definition in the shared object unless it comes from a DT_NEEDED entry of a shared object, in which case, - the DT_NEEDED entry may not be required at the run time. */ + the DT_NEEDED entry may not be required at the run time. */ if (olddef && ! dt_needed && h->root.type == bfd_link_hash_defweak @@ -1218,7 +1217,7 @@ elf_link_add_object_symbols (abfd, info) runpath = 1; rpath = 0; } - /* Ignore DT_RPATH if we have seen DT_RUNPATH. */ + /* Ignore DT_RPATH if we have seen DT_RUNPATH. */ if (!runpath && dyn.d_tag == DT_RPATH) { struct bfd_link_needed_list *n, **pn; @@ -1660,10 +1659,10 @@ elf_link_add_object_symbols (abfd, info) /* Combine visibilities, using the most constraining one. */ unsigned char hvis = ELF_ST_VISIBILITY (h->other); unsigned char symvis = ELF_ST_VISIBILITY (sym.st_other); - + if (symvis && (hvis > symvis || hvis == 0)) h->other = sym.st_other; - + /* If neither has visibility, use the st_other of the definition. This is an arbitrary choice, since the other bits have no general meaning. */ @@ -1942,7 +1941,7 @@ elf_link_add_object_symbols (abfd, info) switch (ELF_ST_VISIBILITY (h->other)) { case STV_INTERNAL: - case STV_HIDDEN: + case STV_HIDDEN: h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; (*bed->elf_backend_hide_symbol) (info, h); break; @@ -1957,7 +1956,7 @@ elf_link_add_object_symbols (abfd, info) /* The symbol from a DT_NEEDED object is referenced from the regular object to create a dynamic executable. We - have to make sure there is a DT_NEEDED entry for it. */ + have to make sure there is a DT_NEEDED entry for it. */ dt_needed = false; oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); @@ -2534,7 +2533,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, { size_t size; - size = (o->reloc_count * bed->s->int_rels_per_ext_rel + size = (o->reloc_count * bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela)); if (keep_memory) internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size); @@ -2560,8 +2559,8 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs, external_relocs, internal_relocs)) goto error_return; - if (!elf_link_read_relocs_from_section - (abfd, + if (!elf_link_read_relocs_from_section + (abfd, elf_section_data (o)->rel_hdr2, ((bfd_byte *) external_relocs) + rel_hdr->sh_size, internal_relocs + (rel_hdr->sh_size / rel_hdr->sh_entsize @@ -3000,7 +2999,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, /* If there are initialization and/or finalization functions to call then add the corresponding DT_INIT/DT_FINI entries. */ h = (info->init_function - ? elf_link_hash_lookup (elf_hash_table (info), + ? elf_link_hash_lookup (elf_hash_table (info), info->init_function, false, false, false) : NULL); @@ -3012,7 +3011,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, return false; } h = (info->fini_function - ? elf_link_hash_lookup (elf_hash_table (info), + ? elf_link_hash_lookup (elf_hash_table (info), info->fini_function, false, false, false) : NULL); @@ -3349,7 +3348,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, } } - /* Assign dynsym indicies. In a shared library we generate a + /* Assign dynsym indicies. In a shared library we generate a section symbol for each output section, which come first. Next come all of the back-end allocated local dynamic syms, followed by the rest of the global symbols. */ @@ -3420,7 +3419,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath, memset (s->contents, 0, (size_t) s->_raw_size); bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); - bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, s->contents + hash_entry_size); elf_hash_table (info)->bucketcount = bucketcount; @@ -3895,7 +3894,7 @@ elf_link_assign_sym_version (h, data) int version_index; /* If we aren't going to export this symbol, we don't need - to worry about it. */ + to worry about it. */ if (h->dynindx == -1) return true; @@ -4109,7 +4108,7 @@ elf_link_size_reloc_section (abfd, rel_hdr, o) rel_hdr->contents = (PTR) bfd_zalloc (abfd, rel_hdr->sh_size); if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) return false; - + /* We only allocate one set of hash entries, so we only do it the first time we are called. */ if (elf_section_data (o)->rel_hashes == NULL) @@ -4155,7 +4154,7 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) { Elf_External_Rel *erel; Elf_Internal_Rel irel; - + erel = (Elf_External_Rel *) rel_hdr->contents + i; if (bed->s->swap_reloc_in) (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, &irel); @@ -4172,10 +4171,10 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash) { Elf_External_Rela *erela; Elf_Internal_Rela irela; - + BFD_ASSERT (rel_hdr->sh_entsize == sizeof (Elf_External_Rela)); - + erela = (Elf_External_Rela *) rel_hdr->contents + i; if (bed->s->swap_reloca_in) (*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, &irela); @@ -4366,9 +4365,9 @@ elf_bfd_final_link (abfd, info) if (output_section != NULL && (o->flags & SEC_RELOC) != 0) { - struct bfd_elf_section_data *esdi + struct bfd_elf_section_data *esdi = elf_section_data (o); - struct bfd_elf_section_data *esdo + struct bfd_elf_section_data *esdo = elf_section_data (output_section); unsigned int *rel_count; unsigned int *rel_count2; @@ -4385,11 +4384,11 @@ elf_bfd_final_link (abfd, info) rel_count = &esdo->rel_count2; rel_count2 = &esdo->rel_count; } - - *rel_count += (esdi->rel_hdr.sh_size + + *rel_count += (esdi->rel_hdr.sh_size / esdi->rel_hdr.sh_entsize); if (esdi->rel_hdr2) - *rel_count2 += (esdi->rel_hdr2->sh_size + *rel_count2 += (esdi->rel_hdr2->sh_size / esdi->rel_hdr2->sh_entsize); } } @@ -4413,7 +4412,7 @@ elf_bfd_final_link (abfd, info) } /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them - to count upwards while actually outputting the relocations. */ + to count upwards while actually outputting the relocations. */ elf_section_data (o)->rel_count = 0; elf_section_data (o)->rel_count2 = 0; } @@ -4592,7 +4591,7 @@ elf_bfd_final_link (abfd, info) /* That wrote out all the local symbols. Finish up the symbol table with the global symbols. Even if we want to strip everything we can, we still need to deal with those global symbols that got - converted to local in a version script. */ + converted to local in a version script. */ if (info->shared) { @@ -4705,7 +4704,7 @@ elf_bfd_final_link (abfd, info) Elf_Internal_Sym *, asection *))) elf_link_output_sym)) return false; - } + } /* Flush all symbols to the file. */ if (! elf_link_flush_output_syms (&finfo)) @@ -4744,13 +4743,13 @@ elf_bfd_final_link (abfd, info) if ((o->flags & SEC_RELOC) == 0) continue; - elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, + elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, elf_section_data (o)->rel_count, elf_section_data (o)->rel_hashes); if (elf_section_data (o)->rel_hdr2 != NULL) elf_link_adjust_relocs (abfd, elf_section_data (o)->rel_hdr2, elf_section_data (o)->rel_count2, - (elf_section_data (o)->rel_hashes + (elf_section_data (o)->rel_hashes + elf_section_data (o)->rel_count)); /* Set the reloc_count field to 0 to prevent write_relocs from @@ -5268,7 +5267,7 @@ elf_link_output_extsym (h, data) } /* If a symbol is not defined locally, we clear the visibility - field. */ + field. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other); @@ -5293,7 +5292,7 @@ elf_link_output_extsym (h, data) bucketcount = elf_hash_table (finfo->info)->bucketcount; bucket = h->elf_hash_value % bucketcount; - hash_entry_size + hash_entry_size = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; bucketpos = ((bfd_byte *) finfo->hash_sec->contents + (bucket + 2) * hash_entry_size); @@ -5353,7 +5352,7 @@ elf_link_output_extsym (h, data) OUTPUT_BFD. */ static void -elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, +elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, internal_relocs) bfd *output_bfd; asection *input_section; @@ -5370,7 +5369,7 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr, output_section = input_section->output_section; output_rel_hdr = NULL; - if (elf_section_data (output_section)->rel_hdr.sh_entsize + if (elf_section_data (output_section)->rel_hdr.sh_entsize == input_rel_hdr->sh_entsize) { output_rel_hdr = &elf_section_data (output_section)->rel_hdr; @@ -5719,7 +5718,7 @@ elf_link_input_bfd (finfo, input_bfd) /* Adjust the reloc addresses and symbol indices. */ irela = internal_relocs; - irelaend = + irelaend = irela + o->reloc_count * bed->s->int_rels_per_ext_rel; rel_hash = (elf_section_data (o->output_section)->rel_hashes + elf_section_data (o->output_section)->rel_count @@ -5772,7 +5771,7 @@ elf_link_input_bfd (finfo, input_bfd) continue; } - /* This is a reloc against a local symbol. */ + /* This is a reloc against a local symbol. */ *rel_hash = NULL; isym = finfo->internal_syms + r_symndx; @@ -5851,14 +5850,14 @@ elf_link_input_bfd (finfo, input_bfd) /* Swap out the relocs. */ input_rel_hdr = &elf_section_data (o)->rel_hdr; - elf_link_output_relocs (output_bfd, o, + elf_link_output_relocs (output_bfd, o, input_rel_hdr, internal_relocs); - internal_relocs + internal_relocs += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize; input_rel_hdr = elf_section_data (o)->rel_hdr2; if (input_rel_hdr) - elf_link_output_relocs (output_bfd, o, + elf_link_output_relocs (output_bfd, o, input_rel_hdr, internal_relocs); } @@ -6404,22 +6403,22 @@ elf_gc_mark (info, sec, gc_mark_hook) { elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); if (ELF_ST_BIND (s.st_info) == STB_LOCAL) - rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s); + rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); else { h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL); + rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); } } else if (r_symndx >= nlocsyms) { h = sym_hashes[r_symndx - extsymoff]; - rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL); + rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL); } else { elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s); - rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s); + rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s); } if (rsec && !rsec->gc_mark) @@ -6490,7 +6489,7 @@ elf_gc_sweep (info, gc_sweep_hook) if (internal_relocs == NULL) return false; - r = (*gc_sweep_hook)(o->owner, info, o, internal_relocs); + r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs); if (!info->keep_memory) free (internal_relocs); @@ -6543,7 +6542,7 @@ elf_gc_propagate_vtable_entries_used (h, okp) struct elf_link_hash_entry *h; PTR okp; { - /* Those that are not vtables. */ + /* Those that are not vtables. */ if (h->vtable_parent == NULL) return true; @@ -6785,7 +6784,7 @@ elf_gc_record_vtentry (abfd, sec, h, addend) if (ptr) { ptr = bfd_realloc (ptr - 1, bytes); - + if (ptr != NULL) { size_t oldbytes; @@ -6799,12 +6798,12 @@ elf_gc_record_vtentry (abfd, sec, h, addend) if (ptr == NULL) return false; - + /* And arrange for that done flag to be at index -1. */ h->vtable_entries_used = ptr + 1; h->vtable_entries_size = size; } - + h->vtable_entries_used[addend / FILE_ALIGN] = true; return true; diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 56087a6e0c..5105c4ec16 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opcode/ia64.h" #include "elf/ia64.h" - /* * THE RULES for all the stuff the linker creates -- * @@ -83,7 +82,7 @@ struct elfNN_ia64_dyn_sym_info /* The symbol table entry, if any, that this was derrived from. */ struct elf_link_hash_entry *h; - + /* Used to count non-got, non-plt relocations for delayed sizing of relocation sections. */ struct elfNN_ia64_dyn_reloc_entry @@ -188,7 +187,7 @@ static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup boolean create, boolean copy)); static void elfNN_ia64_dyn_sym_traverse PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, - boolean (*func)(struct elfNN_ia64_dyn_sym_info *, PTR), + boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), PTR info)); static boolean elfNN_ia64_create_dynamic_sections PARAMS ((bfd *abfd, struct bfd_link_info *info)); @@ -710,8 +709,8 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) tsec = bfd_com_section_ptr; else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE) tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); - else - continue; /* who knows. */ + else + continue; /* who knows. */ toff = isym.st_value; } @@ -1156,7 +1155,6 @@ elfNN_ia64_modify_segment_map (abfd) return true; } - /* According to the Tahoe assembler spec, all labels starting with a '.' are local. */ @@ -1204,7 +1202,7 @@ elfNN_ia64_local_hash_table_init (ht, abfd, new) bfd *abfd ATTRIBUTE_UNUSED; new_hash_entry_func new; { - memset (ht, 0, sizeof(*ht)); + memset (ht, 0, sizeof (*ht)); return bfd_hash_table_init (&ht->root, new); } @@ -1227,7 +1225,7 @@ elfNN_ia64_new_loc_hash_entry (entry, table, string) /* Initialize our local data. All zeros, and definitely easier than setting a handful of bit fields. */ - memset (ret, 0, sizeof(*ret)); + memset (ret, 0, sizeof (*ret)); /* Call the allocation method of the superclass. */ ret = ((struct elfNN_ia64_local_hash_entry *) @@ -1255,7 +1253,7 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string) /* Initialize our local data. All zeros, and definitely easier than setting a handful of bit fields. */ - memset (ret, 0, sizeof(*ret)); + memset (ret, 0, sizeof (*ret)); /* Call the allocation method of the superclass. */ ret = ((struct elfNN_ia64_link_hash_entry *) @@ -1274,7 +1272,7 @@ elfNN_ia64_hash_copy_indirect (xdir, xind) dir = (struct elfNN_ia64_link_hash_entry *)xdir; ind = (struct elfNN_ia64_link_hash_entry *)xind; - /* Copy down any references that we may have already seen to the + /* Copy down any references that we may have already seen to the symbol which just became indirect. */ dir->root.elf_link_hash_flags |= @@ -1488,7 +1486,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) struct elfNN_ia64_dyn_sym_info **pp; struct elfNN_ia64_dyn_sym_info *dyn_i; bfd_vma addend = rel ? rel->r_addend : 0; - + if (h) pp = &((struct elfNN_ia64_link_hash_entry *)h)->info; else @@ -1500,7 +1498,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) /* Construct a string for use in the elfNN_ia64_local_hash_table. The name describes what was once anonymous memory. */ - len = sizeof(void*)*2 + 1 + sizeof(bfd_vma)*4 + 1 + 1; + len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1; len += 10; /* %p slop */ addr_name = alloca (len); @@ -1512,7 +1510,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) BFD_ASSERT (loc_h); pp = &loc_h->info; - } + } for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp) pp = &dyn_i->next; @@ -2047,7 +2045,7 @@ allocate_fptr (dyn_i, data) if (dyn_i->want_fptr) { struct elf_link_hash_entry *h = dyn_i->h; - + if (h) while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) @@ -2504,7 +2502,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0) || ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0) || ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT, - sizeof(ElfNN_External_Rela))) + sizeof (ElfNN_External_Rela))) return false; if (reltext) @@ -2541,7 +2539,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) case R_IA64_LDXMOV: return bfd_reloc_ok; - /* Instruction relocations. */ + /* Instruction relocations. */ case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break; @@ -2686,7 +2684,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type) case 0: shift = 5; break; case 1: shift = 14; hit_addr += 3; break; case 2: shift = 23; hit_addr += 6; break; - case 3: return bfd_reloc_notsupported; /* shouldn't happen... */ + case 3: return bfd_reloc_notsupported; /* shouldn't happen... */ } dword = bfd_get_64 (abfd, hit_addr); insn = (dword >> shift) & 0x1ffffffffffLL; @@ -2765,7 +2763,7 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, bfd_elfNN_swap_reloca_out (abfd, &outrel, ((ElfNN_External_Rela *) srel->contents + srel->reloc_count++)); - BFD_ASSERT (sizeof(ElfNN_External_Rela) * srel->reloc_count + BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count <= srel->_cooked_size); } @@ -3057,7 +3055,7 @@ elfNN_ia64_final_link (abfd, info) (*_bfd_error_handler) (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), bfd_get_filename (abfd), - (unsigned long)(max_short_vma - min_short_vma)); + (unsigned long) (max_short_vma - min_short_vma)); return false; } else if ((gp_val > min_short_vma @@ -3618,7 +3616,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, if (! dynamic_symbol_p) { unsigned int dyn_r_type; - + if (r_type == R_IA64_IPLTMSB) dyn_r_type = R_IA64_REL64MSB; else @@ -3873,7 +3871,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) case DT_RELASZ: /* Do not have RELASZ include JMPREL. This makes things - easier on ld.so. This is not what the rest of BFD set up. */ + easier on ld.so. This is not what the rest of BFD set up. */ dyn.d_un.d_val -= (ia64_info->minplt_entries * sizeof (ElfNN_External_Rela)); break; @@ -3903,7 +3901,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) /* ELF file flag handling: */ -/* Function to keep IA-64 specific file flags. */ +/* Function to keep IA-64 specific file flags. */ static boolean elfNN_ia64_set_private_flags (abfd, flags) bfd *abfd; @@ -4045,7 +4043,7 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) (flags & EF_IA_64_NOFUNCDESC_CONS_GP) ? "NOFUNCDESC_CONS_GP, " : "", (flags & EF_IA_64_ABSOLUTE) ? "ABSOLUTE, " : "", (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32"); - + _bfd_elf_print_private_bfd_data (abfd, ptr); return true; } diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 6957e3ae2c..e69036f489 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -325,16 +325,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #else #undef USE_REL #define USE_REL 1 -#endif +#endif /* Use these in new code. */ -#ifndef elf_backend_may_use_rel_p +#ifndef elf_backend_may_use_rel_p #define elf_backend_may_use_rel_p USE_REL -#endif +#endif #ifndef elf_backend_may_use_rela_p #define elf_backend_may_use_rela_p !USE_REL #endif -#ifndef elf_backend_default_use_rela_p +#ifndef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p !USE_REL #endif @@ -608,7 +608,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + /* backend_data: */ (PTR) &elfNN_bed }; -- 2.11.0