mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 18:08:24 +08:00
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
This commit is contained in:
294
bfd/elf.c
294
bfd/elf.c
@ -463,7 +463,7 @@ bfd_elf_get_elf_syms (bfd *ibfd,
|
||||
if (extshndx_buf == NULL)
|
||||
{
|
||||
alloc_extshndx = (Elf_External_Sym_Shndx *)
|
||||
bfd_malloc2 (symcount, sizeof (Elf_External_Sym_Shndx));
|
||||
bfd_malloc2 (symcount, sizeof (Elf_External_Sym_Shndx));
|
||||
extshndx_buf = alloc_extshndx;
|
||||
}
|
||||
if (extshndx_buf == NULL
|
||||
@ -478,7 +478,7 @@ bfd_elf_get_elf_syms (bfd *ibfd,
|
||||
if (intsym_buf == NULL)
|
||||
{
|
||||
alloc_intsym = (Elf_Internal_Sym *)
|
||||
bfd_malloc2 (symcount, sizeof (Elf_Internal_Sym));
|
||||
bfd_malloc2 (symcount, sizeof (Elf_Internal_Sym));
|
||||
intsym_buf = alloc_intsym;
|
||||
if (intsym_buf == NULL)
|
||||
goto out;
|
||||
@ -487,7 +487,7 @@ bfd_elf_get_elf_syms (bfd *ibfd,
|
||||
/* Convert the symbols to internal form. */
|
||||
isymend = intsym_buf + symcount;
|
||||
for (esym = (const bfd_byte *) extsym_buf, isym = intsym_buf,
|
||||
shndx = extshndx_buf;
|
||||
shndx = extshndx_buf;
|
||||
isym < isymend;
|
||||
esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
|
||||
if (!(*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym))
|
||||
@ -624,7 +624,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
|
||||
|
||||
elf_tdata (abfd)->num_group = num_group;
|
||||
elf_tdata (abfd)->group_sect_ptr = (Elf_Internal_Shdr **)
|
||||
bfd_alloc2 (abfd, num_group, sizeof (Elf_Internal_Shdr *));
|
||||
bfd_alloc2 (abfd, num_group, sizeof (Elf_Internal_Shdr *));
|
||||
if (elf_tdata (abfd)->group_sect_ptr == NULL)
|
||||
return FALSE;
|
||||
memset (elf_tdata (abfd)->group_sect_ptr, 0, num_group * sizeof (Elf_Internal_Shdr *));
|
||||
@ -639,11 +639,11 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
|
||||
unsigned char *src;
|
||||
Elf_Internal_Group *dest;
|
||||
|
||||
/* Make sure the group section has a BFD section
|
||||
attached to it. */
|
||||
if (!bfd_section_from_shdr (abfd, i))
|
||||
return FALSE;
|
||||
|
||||
/* Make sure the group section has a BFD section
|
||||
attached to it. */
|
||||
if (!bfd_section_from_shdr (abfd, i))
|
||||
return FALSE;
|
||||
|
||||
/* Add to list of sections. */
|
||||
elf_tdata (abfd)->group_sect_ptr[num_group] = shdr;
|
||||
num_group += 1;
|
||||
@ -652,7 +652,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
|
||||
BFD_ASSERT (sizeof (*dest) >= 4);
|
||||
amt = shdr->sh_size * sizeof (*dest) / 4;
|
||||
shdr->contents = (unsigned char *)
|
||||
bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4);
|
||||
bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4);
|
||||
/* PR binutils/4110: Handle corrupt group headers. */
|
||||
if (shdr->contents == NULL)
|
||||
{
|
||||
@ -1279,7 +1279,7 @@ section_match (const Elf_Internal_Shdr * a,
|
||||
const Elf_Internal_Shdr * b)
|
||||
{
|
||||
return
|
||||
a->sh_type == b->sh_type
|
||||
a->sh_type == b->sh_type
|
||||
&& (a->sh_flags & ~ SHF_INFO_LINK)
|
||||
== (b->sh_flags & ~ SHF_INFO_LINK)
|
||||
&& a->sh_addralign == b->sh_addralign
|
||||
@ -1327,7 +1327,7 @@ find_link (const bfd *obfd, const Elf_Internal_Shdr *iheader,
|
||||
/* PR 19938: Attempt to set the ELF section header fields of an OS or
|
||||
Processor specific section, based upon a matching input section.
|
||||
Returns TRUE upon success, FALSE otherwise. */
|
||||
|
||||
|
||||
static bfd_boolean
|
||||
copy_special_section_fields (const bfd *ibfd,
|
||||
bfd *obfd,
|
||||
@ -1430,7 +1430,7 @@ copy_special_section_fields (const bfd *ibfd,
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
/* Copy the program header and other data from one object module to
|
||||
another. */
|
||||
|
||||
@ -1462,7 +1462,7 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
|
||||
if (elf_elfheader (ibfd)->e_ident[EI_ABIVERSION])
|
||||
elf_elfheader (obfd)->e_ident[EI_ABIVERSION]
|
||||
= elf_elfheader (ibfd)->e_ident[EI_ABIVERSION];
|
||||
|
||||
|
||||
/* Copy object attributes. */
|
||||
_bfd_elf_copy_obj_attributes (ibfd, obfd);
|
||||
|
||||
@ -1658,7 +1658,7 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
|
||||
goto error_return;
|
||||
extdynend = extdyn + s->size;
|
||||
/* PR 17512: file: id:000006,sig:06,src:000000,op:flip4,pos:5664.
|
||||
Fix range check. */
|
||||
Fix range check. */
|
||||
for (; extdyn <= (extdynend - extdynsize); extdyn += extdynsize)
|
||||
{
|
||||
Elf_Internal_Dyn dyn;
|
||||
@ -2222,7 +2222,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
|
||||
for (entry = elf_symtab_shndx_list (abfd); entry != NULL; entry = entry->next)
|
||||
if (entry->ndx == shindex)
|
||||
goto success;
|
||||
|
||||
|
||||
entry = bfd_alloc (abfd, sizeof * entry);
|
||||
if (entry == NULL)
|
||||
goto fail;
|
||||
@ -2575,95 +2575,95 @@ bfd_section_from_elf_index (bfd *abfd, unsigned int sec_index)
|
||||
static const struct bfd_elf_special_section special_sections_b[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".bss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_c[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".comment"), 0, SHT_PROGBITS, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_d[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
/* There are more DWARF sections than these, but they needn't be added here
|
||||
unless you have to cope with broken compilers that don't emit section
|
||||
attributes or you want to help the user writing assembler. */
|
||||
{ STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".debug_aranges"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_f[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".fini_array"), -2, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
|
||||
{ NULL, 0 , 0, 0, 0 }
|
||||
{ NULL, 0 , 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_g[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".gnu.linkonce.b"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".gnu.lto_"), -1, SHT_PROGBITS, SHF_EXCLUDE },
|
||||
{ STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 },
|
||||
{ STRING_COMMA_LEN (".gnu.lto_"), -1, SHT_PROGBITS, SHF_EXCLUDE },
|
||||
{ STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 },
|
||||
{ STRING_COMMA_LEN (".gnu.version_d"), 0, SHT_GNU_verdef, 0 },
|
||||
{ STRING_COMMA_LEN (".gnu.version_r"), 0, SHT_GNU_verneed, 0 },
|
||||
{ STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_h[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_i[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".init_array"), -2, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_l[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".line"), 0, SHT_PROGBITS, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_n[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_p[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".preinit_array"), -2, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
|
||||
{ STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_r[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC },
|
||||
{ STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 },
|
||||
{ STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 },
|
||||
{ STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_s[] =
|
||||
@ -2674,24 +2674,24 @@ static const struct bfd_elf_special_section special_sections_s[] =
|
||||
/* See struct bfd_elf_special_section declaration for the semantics of
|
||||
this special case where .prefix_length != strlen (.prefix). */
|
||||
{ ".stabstr", 5, 3, SHT_STRTAB, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_t[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
|
||||
{ STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
|
||||
{ STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
|
||||
{ STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section special_sections_z[] =
|
||||
{
|
||||
{ STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".zdebug_abbrev"), 0, SHT_PROGBITS, 0 },
|
||||
{ STRING_COMMA_LEN (".zdebug_aranges"), 0, SHT_PROGBITS, 0 },
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
{ NULL, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const struct bfd_elf_special_section * const special_sections[] =
|
||||
@ -2819,7 +2819,7 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
|
||||
if (sdata == NULL)
|
||||
{
|
||||
sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd,
|
||||
sizeof (*sdata));
|
||||
sizeof (*sdata));
|
||||
if (sdata == NULL)
|
||||
return FALSE;
|
||||
sec->used_by_bfd = sdata;
|
||||
@ -3733,12 +3733,12 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
|
||||
/* Set up the list of section header pointers, in agreement with the
|
||||
indices. */
|
||||
i_shdrp = (Elf_Internal_Shdr **) bfd_zalloc2 (abfd, section_number,
|
||||
sizeof (Elf_Internal_Shdr *));
|
||||
sizeof (Elf_Internal_Shdr *));
|
||||
if (i_shdrp == NULL)
|
||||
return FALSE;
|
||||
|
||||
i_shdrp[0] = (Elf_Internal_Shdr *) bfd_zalloc (abfd,
|
||||
sizeof (Elf_Internal_Shdr));
|
||||
sizeof (Elf_Internal_Shdr));
|
||||
if (i_shdrp[0] == NULL)
|
||||
{
|
||||
bfd_release (abfd, i_shdrp);
|
||||
@ -4110,7 +4110,7 @@ elf_map_symbols (bfd *abfd, unsigned int *pnum_locals)
|
||||
|
||||
/* Now sort the symbols so the local symbols are first. */
|
||||
new_syms = (asymbol **) bfd_alloc2 (abfd, num_locals + num_globals,
|
||||
sizeof (asymbol *));
|
||||
sizeof (asymbol *));
|
||||
|
||||
if (new_syms == NULL)
|
||||
return FALSE;
|
||||
@ -4475,7 +4475,7 @@ _bfd_elf_make_dynamic_segment (bfd *abfd, asection *dynsec)
|
||||
struct elf_segment_map *m;
|
||||
|
||||
m = (struct elf_segment_map *) bfd_zalloc (abfd,
|
||||
sizeof (struct elf_segment_map));
|
||||
sizeof (struct elf_segment_map));
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
m->next = NULL;
|
||||
@ -4577,7 +4577,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
|
||||
/* Select the allocated sections, and sort them. */
|
||||
|
||||
sections = (asection **) bfd_malloc2 (bfd_count_sections (abfd),
|
||||
sizeof (asection *));
|
||||
sizeof (asection *));
|
||||
if (sections == NULL)
|
||||
goto error_return;
|
||||
|
||||
@ -5277,8 +5277,8 @@ assign_file_positions_for_load_sections (bfd *abfd,
|
||||
== 0);
|
||||
phdrs = (Elf_Internal_Phdr *)
|
||||
bfd_zalloc2 (abfd,
|
||||
(elf_program_header_size (abfd) / bed->s->sizeof_phdr),
|
||||
sizeof (Elf_Internal_Phdr));
|
||||
(elf_program_header_size (abfd) / bed->s->sizeof_phdr),
|
||||
sizeof (Elf_Internal_Phdr));
|
||||
elf_tdata (abfd)->phdr = phdrs;
|
||||
if (phdrs == NULL)
|
||||
return FALSE;
|
||||
@ -5560,7 +5560,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
|
||||
if (p->p_filesz + adjust < p->p_memsz)
|
||||
{
|
||||
/* We have a PROGBITS section following NOBITS ones.
|
||||
Allocate file space for the NOBITS section(s) and
|
||||
Allocate file space for the NOBITS section(s) and
|
||||
zero it. */
|
||||
adjust = p->p_memsz - p->p_filesz;
|
||||
if (!write_zeros (abfd, off, adjust))
|
||||
@ -5891,7 +5891,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
|
||||
abort ();
|
||||
p->p_memsz = p->p_filesz;
|
||||
/* Preserve the alignment and flags if they are valid. The
|
||||
gold linker generates RW/4 for the PT_GNU_RELRO section.
|
||||
gold linker generates RW/4 for the PT_GNU_RELRO section.
|
||||
It is better for objcopy/strip to honor these attributes
|
||||
otherwise gdb will choke when using separate debug files.
|
||||
*/
|
||||
@ -6096,7 +6096,7 @@ assign_file_positions_except_relocs (bfd *abfd,
|
||||
FIXME: We used to have code here to sort the PT_LOAD segments into
|
||||
ascending order, as per the ELF spec. But this breaks some programs,
|
||||
including the Linux kernel. But really either the spec should be
|
||||
changed or the programs updated. */
|
||||
changed or the programs updated. */
|
||||
if (alloc > 1
|
||||
&& tdata->phdr[0].p_type == PT_PHDR
|
||||
&& ! bed->elf_backend_allow_non_load_phdr (abfd, tdata->phdr, alloc)
|
||||
@ -6788,7 +6788,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
|
||||
/* Special segments, such as the PT_PHDR segment, may contain
|
||||
no sections, but ordinary, loadable segments should contain
|
||||
something. They are allowed by the ELF spec however, so only
|
||||
a warning is produced.
|
||||
a warning is produced.
|
||||
There is however the valid use case of embedded systems which
|
||||
have segments with p_filesz of 0 and a p_memsz > 0 to initialize
|
||||
flash memory with zeros. No warning is shown for that case. */
|
||||
@ -7721,7 +7721,7 @@ swap_out_syms (bfd *abfd,
|
||||
}
|
||||
|
||||
outbound_syms = (bfd_byte *) bfd_alloc2 (abfd, 1 + symcount,
|
||||
bed->s->sizeof_sym);
|
||||
bed->s->sizeof_sym);
|
||||
if (outbound_syms == NULL)
|
||||
{
|
||||
error_return:
|
||||
@ -8271,8 +8271,8 @@ error_return_verref:
|
||||
else
|
||||
{
|
||||
iverneed->vn_auxptr = (struct elf_internal_vernaux *)
|
||||
bfd_alloc2 (abfd, iverneed->vn_cnt,
|
||||
sizeof (Elf_Internal_Vernaux));
|
||||
bfd_alloc2 (abfd, iverneed->vn_cnt,
|
||||
sizeof (Elf_Internal_Vernaux));
|
||||
if (iverneed->vn_auxptr == NULL)
|
||||
goto error_return_verref;
|
||||
}
|
||||
@ -8435,8 +8435,8 @@ error_return_verref:
|
||||
else
|
||||
{
|
||||
iverdef->vd_auxptr = (struct elf_internal_verdaux *)
|
||||
bfd_alloc2 (abfd, iverdef->vd_cnt,
|
||||
sizeof (Elf_Internal_Verdaux));
|
||||
bfd_alloc2 (abfd, iverdef->vd_cnt,
|
||||
sizeof (Elf_Internal_Verdaux));
|
||||
if (iverdef->vd_auxptr == NULL)
|
||||
goto error_return_verdef;
|
||||
}
|
||||
@ -8500,7 +8500,7 @@ error_return_verref:
|
||||
freeidx++;
|
||||
|
||||
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *)
|
||||
bfd_zalloc2 (abfd, freeidx, sizeof (Elf_Internal_Verdef));
|
||||
bfd_zalloc2 (abfd, freeidx, sizeof (Elf_Internal_Verdef));
|
||||
if (elf_tdata (abfd)->verdef == NULL)
|
||||
goto error_return;
|
||||
|
||||
@ -8593,7 +8593,7 @@ _bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
forward-backward labels (aka local labels) as locals.
|
||||
These labels have the form:
|
||||
|
||||
L0^A.* (fake symbols)
|
||||
L0^A.* (fake symbols)
|
||||
|
||||
[.]?L[0123456789]+{^A|^B}[0123456789]* (local labels)
|
||||
|
||||
@ -9634,73 +9634,73 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
|
||||
|
||||
case NT_PPC_VSX:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_ppc_vsx (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_ppc_vsx (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_HIGH_GPRS:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_high_gprs (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_high_gprs (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_TIMER:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_timer (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_timer (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_TODCMP:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_todcmp (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_todcmp (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_TODPREG:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_todpreg (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_todpreg (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_CTRS:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_ctrs (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_ctrs (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_PREFIX:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_prefix (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_prefix (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_LAST_BREAK:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_last_break (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_last_break (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_SYSTEM_CALL:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_system_call (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_system_call (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_TDB:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_tdb (abfd, note);
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_tdb (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_VXRS_LOW:
|
||||
if (note->namesz == 6
|
||||
@ -10261,8 +10261,8 @@ elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, long *tid)
|
||||
if (sect == NULL)
|
||||
return FALSE;
|
||||
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->alignment_power = 2;
|
||||
|
||||
return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect));
|
||||
@ -10290,8 +10290,8 @@ elfcore_grok_nto_regs (bfd *abfd,
|
||||
if (sect == NULL)
|
||||
return FALSE;
|
||||
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->alignment_power = 2;
|
||||
|
||||
/* This is the current thread. */
|
||||
@ -10348,8 +10348,8 @@ elfcore_grok_spu_note (bfd *abfd, Elf_Internal_Note *note)
|
||||
if (sect == NULL)
|
||||
return FALSE;
|
||||
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->size = note->descsz;
|
||||
sect->filepos = note->descpos;
|
||||
sect->alignment_power = 1;
|
||||
|
||||
return TRUE;
|
||||
@ -10697,14 +10697,14 @@ elfcore_write_ppc_vmx (bfd *abfd,
|
||||
|
||||
char *
|
||||
elfcore_write_ppc_vsx (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *ppc_vsx,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *ppc_vsx,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_PPC_VSX, ppc_vsx, size);
|
||||
note_name, NT_PPC_VSX, ppc_vsx, size);
|
||||
}
|
||||
|
||||
static char *
|
||||
@ -10716,68 +10716,68 @@ elfcore_write_s390_high_gprs (bfd *abfd,
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_HIGH_GPRS,
|
||||
note_name, NT_S390_HIGH_GPRS,
|
||||
s390_high_gprs, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_timer (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_timer,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_timer,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_TIMER, s390_timer, size);
|
||||
note_name, NT_S390_TIMER, s390_timer, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_todcmp (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_todcmp,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_todcmp,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_TODCMP, s390_todcmp, size);
|
||||
note_name, NT_S390_TODCMP, s390_todcmp, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_todpreg (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_todpreg,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_todpreg,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_TODPREG, s390_todpreg, size);
|
||||
note_name, NT_S390_TODPREG, s390_todpreg, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_ctrs (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_ctrs,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_ctrs,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_CTRS, s390_ctrs, size);
|
||||
note_name, NT_S390_CTRS, s390_ctrs, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_prefix (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_prefix,
|
||||
int size)
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_prefix,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_PREFIX, s390_prefix, size);
|
||||
note_name, NT_S390_PREFIX, s390_prefix, size);
|
||||
}
|
||||
|
||||
char *
|
||||
@ -10789,7 +10789,7 @@ elfcore_write_s390_last_break (bfd *abfd,
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_LAST_BREAK,
|
||||
note_name, NT_S390_LAST_BREAK,
|
||||
s390_last_break, size);
|
||||
}
|
||||
|
||||
@ -10802,7 +10802,7 @@ elfcore_write_s390_system_call (bfd *abfd,
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_SYSTEM_CALL,
|
||||
note_name, NT_S390_SYSTEM_CALL,
|
||||
s390_system_call, size);
|
||||
}
|
||||
|
||||
@ -10815,7 +10815,7 @@ elfcore_write_s390_tdb (bfd *abfd,
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_TDB, s390_tdb, size);
|
||||
note_name, NT_S390_TDB, s390_tdb, size);
|
||||
}
|
||||
|
||||
char *
|
||||
@ -11010,7 +11010,7 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset,
|
||||
return FALSE;
|
||||
|
||||
switch (bfd_get_format (abfd))
|
||||
{
|
||||
{
|
||||
default:
|
||||
return TRUE;
|
||||
|
||||
|
Reference in New Issue
Block a user