aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-12-06 09:26:00 +1030
committerAlan Modra <amodra@gmail.com>2017-12-06 17:51:43 +1030
commit07d6d2b8345ef3dc82eab49635acac9ee67dbb18 (patch)
tree380d1e08ae32b2a37d5f9610f1811bb98299ac09 /bfd/peXXigen.c
parent65281396861dfcfa993eb5af4769d6837104890d (diff)
downloadgdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.zip
gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.gz
gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.bz2
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.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c328
1 files changed, 164 insertions, 164 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index db44053..297f773 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -294,7 +294,7 @@ _bfd_XXi_swap_aux_in (bfd * abfd,
int in_class,
int indx ATTRIBUTE_UNUSED,
int numaux ATTRIBUTE_UNUSED,
- void * in1)
+ void * in1)
{
AUXENT *ext = (AUXENT *) ext1;
union internal_auxent *in = (union internal_auxent *) in1;
@@ -540,7 +540,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++)
{
- /* If data directory is empty, rva also should be 0. */
+ /* If data directory is empty, rva also should be 0. */
int size =
H_GET_32 (abfd, src->DataDirectory[idx][1]);
@@ -974,8 +974,8 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
}
else
{
- ps = 0;
- ss = scnhdr_int->s_size;
+ ps = 0;
+ ss = scnhdr_int->s_size;
}
}
else
@@ -1018,7 +1018,7 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
typedef struct
{
- const char * section_name;
+ const char * section_name;
unsigned long must_have;
}
pe_required_section_flags;
@@ -1094,9 +1094,9 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out)
}
/* Although we could encode 0xffff relocs here, we do not, to be
- consistent with other parts of bfd. Also it lets us warn, as
- we should never see 0xffff here w/o having the overflow flag
- set. */
+ consistent with other parts of bfd. Also it lets us warn, as
+ we should never see 0xffff here w/o having the overflow flag
+ set. */
if (scnhdr_int->s_nreloc < 0xffff)
H_PUT_16 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
else
@@ -1169,8 +1169,8 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length
cvinfo->Age = H_GET_32(abfd, cvinfo70->Age);
/* A GUID consists of 4,2,2 byte values in little-endian order, followed
- by 8 single bytes. Byte swap them so we can conveniently treat the GUID
- as 16 bytes in big-endian order. */
+ by 8 single bytes. Byte swap them so we can conveniently treat the GUID
+ as 16 bytes in big-endian order. */
bfd_putb32 (bfd_getl32 (cvinfo70->Signature), cvinfo->Signature);
bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[4])), &(cvinfo->Signature[4]));
bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[6])), &(cvinfo->Signature[6]));
@@ -1182,7 +1182,7 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length
return cvinfo;
}
else if ((cvinfo->CVSignature == CVINFO_PDB20_CVSIGNATURE)
- && (length > sizeof (CV_INFO_PDB20)))
+ && (length > sizeof (CV_INFO_PDB20)))
{
CV_INFO_PDB20 *cvinfo20 = (CV_INFO_PDB20 *)(buffer);
cvinfo->Age = H_GET_32(abfd, cvinfo20->Age);
@@ -1309,12 +1309,12 @@ pe_print_idata (bfd * abfd, void * vfile)
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
- {
+ {
fprintf (file,
_("\nThere is an import table in %s, but that section has no contents\n"),
section->name);
return TRUE;
- }
+ }
}
/* xgettext:c-format */
@@ -1349,11 +1349,11 @@ pe_print_idata (bfd * abfd, void * vfile)
offset = abfd->start_address - rel_section->vma;
if (offset >= rel_section->size || offset + 8 > rel_section->size)
- {
- if (data != NULL)
- free (data);
- return FALSE;
- }
+ {
+ if (data != NULL)
+ free (data);
+ return FALSE;
+ }
start_address = bfd_get_32 (abfd, data + offset);
loadable_toc_address = bfd_get_32 (abfd, data + offset + 4);
@@ -1425,7 +1425,7 @@ pe_print_idata (bfd * abfd, void * vfile)
break;
if (dll_name - adj >= section->size)
- break;
+ break;
dll = (char *) data + dll_name - adj;
/* PR 17512 file: 078-12277-0.004. */
@@ -1603,14 +1603,14 @@ pe_print_edata (bfd * abfd, void * vfile)
bfd_vma adj;
struct EDT_type
{
- long export_flags; /* Reserved - should be zero. */
+ long export_flags; /* Reserved - should be zero. */
long time_stamp;
short major_ver;
short minor_ver;
- bfd_vma name; /* RVA - relative to image base. */
- long base; /* Ordinal base. */
+ bfd_vma name; /* RVA - relative to image base. */
+ long base; /* Ordinal base. */
unsigned long num_functions;/* Number in the export address table. */
- unsigned long num_names; /* Number in the name pointer table. */
+ unsigned long num_names; /* Number in the name pointer table. */
bfd_vma eat_addr; /* RVA to the export address table. */
bfd_vma npt_addr; /* RVA to the Export Name Pointer Table. */
bfd_vma ot_addr; /* RVA to the Ordinal Table. */
@@ -1651,12 +1651,12 @@ pe_print_edata (bfd * abfd, void * vfile)
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
- {
+ {
fprintf (file,
_("\nThere is an export table in %s, but that section has no contents\n"),
section->name);
return TRUE;
- }
+ }
dataoff = addr - section->vma;
datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size;
@@ -1692,17 +1692,17 @@ pe_print_edata (bfd * abfd, void * vfile)
return FALSE;
/* Go get Export Directory Table. */
- edt.export_flags = bfd_get_32 (abfd, data + 0);
- edt.time_stamp = bfd_get_32 (abfd, data + 4);
- edt.major_ver = bfd_get_16 (abfd, data + 8);
- edt.minor_ver = bfd_get_16 (abfd, data + 10);
- edt.name = bfd_get_32 (abfd, data + 12);
- edt.base = bfd_get_32 (abfd, data + 16);
+ edt.export_flags = bfd_get_32 (abfd, data + 0);
+ edt.time_stamp = bfd_get_32 (abfd, data + 4);
+ edt.major_ver = bfd_get_16 (abfd, data + 8);
+ edt.minor_ver = bfd_get_16 (abfd, data + 10);
+ edt.name = bfd_get_32 (abfd, data + 12);
+ edt.base = bfd_get_32 (abfd, data + 16);
edt.num_functions = bfd_get_32 (abfd, data + 20);
- edt.num_names = bfd_get_32 (abfd, data + 24);
- edt.eat_addr = bfd_get_32 (abfd, data + 28);
- edt.npt_addr = bfd_get_32 (abfd, data + 32);
- edt.ot_addr = bfd_get_32 (abfd, data + 36);
+ edt.num_names = bfd_get_32 (abfd, data + 24);
+ edt.eat_addr = bfd_get_32 (abfd, data + 28);
+ edt.npt_addr = bfd_get_32 (abfd, data + 32);
+ edt.ot_addr = bfd_get_32 (abfd, data + 36);
adj = section->vma - extra->ImageBase + dataoff;
@@ -1768,8 +1768,8 @@ pe_print_edata (bfd * abfd, void * vfile)
forward the call to another dll. Something like:
typedef union
{
- long export_rva;
- long forwarder_rva;
+ long export_rva;
+ long forwarder_rva;
} export_address_table_entry; */
fprintf (file,
@@ -1953,10 +1953,10 @@ pe_print_pdata (bfd * abfd, void * vfile)
if (i + PDATA_ROW_SIZE > stop)
break;
- begin_addr = GET_PDATA_ENTRY (abfd, data + i );
- end_addr = GET_PDATA_ENTRY (abfd, data + i + 4);
+ begin_addr = GET_PDATA_ENTRY (abfd, data + i );
+ end_addr = GET_PDATA_ENTRY (abfd, data + i + 4);
eh_handler = GET_PDATA_ENTRY (abfd, data + i + 8);
- eh_data = GET_PDATA_ENTRY (abfd, data + i + 12);
+ eh_data = GET_PDATA_ENTRY (abfd, data + i + 12);
prolog_end_addr = GET_PDATA_ENTRY (abfd, data + i + 16);
if (begin_addr == 0 && end_addr == 0 && eh_handler == 0
@@ -2019,7 +2019,7 @@ pe_print_pdata (bfd * abfd, void * vfile)
typedef struct sym_cache
{
- int symcount;
+ int symcount;
asymbol ** syms;
} sym_cache;
@@ -2154,8 +2154,8 @@ _bfd_XX_print_ce_compressed_pdata (bfd * abfd, void * vfile)
fprintf (file, "%2d %2d ", flag32bit, exception_flag);
/* Get the exception handler's address and the data passed from the
- .text section. This is really the data that belongs with the .pdata
- but got "compressed" out for the ARM and SH4 architectures. */
+ .text section. This is really the data that belongs with the .pdata
+ but got "compressed" out for the ARM and SH4 architectures. */
tsection = bfd_get_section_by_name (abfd, ".text");
if (tsection && coff_section_data (abfd, tsection)
&& pei_section_data (abfd, tsection))
@@ -2322,13 +2322,13 @@ rsrc_print_resource_directory (FILE * , bfd *, unsigned int, bfd_byte *,
or section_end + 1 upon failure. */
static bfd_byte *
-rsrc_print_resource_entries (FILE * file,
- bfd * abfd,
+rsrc_print_resource_entries (FILE * file,
+ bfd * abfd,
unsigned int indent,
bfd_boolean is_name,
- bfd_byte * data,
+ bfd_byte * data,
rsrc_regions * regions,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned long entry, addr, size;
bfd_byte * leaf;
@@ -2443,12 +2443,12 @@ rsrc_print_resource_entries (FILE * file,
#define min(a,b) ((a) < (b) ? (a) : (b))
static bfd_byte *
-rsrc_print_resource_directory (FILE * file,
- bfd * abfd,
+rsrc_print_resource_directory (FILE * file,
+ bfd * abfd,
unsigned int indent,
bfd_byte * data,
rsrc_regions * regions,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned int num_names, num_ids;
bfd_byte * highest_data = data;
@@ -2639,27 +2639,27 @@ pe_print_debugdata (bfd * abfd, void * vfile)
for (section = abfd->sections; section != NULL; section = section->next)
{
if ((addr >= section->vma) && (addr < (section->vma + section->size)))
- break;
+ break;
}
if (section == NULL)
{
fprintf (file,
- _("\nThere is a debug directory, but the section containing it could not be found\n"));
+ _("\nThere is a debug directory, but the section containing it could not be found\n"));
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
{
fprintf (file,
- _("\nThere is a debug directory in %s, but that section has no contents\n"),
- section->name);
+ _("\nThere is a debug directory in %s, but that section has no contents\n"),
+ section->name);
return TRUE;
}
else if (section->size < size)
{
fprintf (file,
- _("\nError: section %s contains the debug data starting address but it is too small\n"),
- section->name);
+ _("\nError: section %s contains the debug data starting address but it is too small\n"),
+ section->name);
return FALSE;
}
@@ -2695,43 +2695,43 @@ pe_print_debugdata (bfd * abfd, void * vfile)
_bfd_XXi_swap_debugdir_in (abfd, ext, &idd);
if ((idd.Type) >= IMAGE_NUMBEROF_DEBUG_TYPES)
- type_name = debug_type_names[0];
+ type_name = debug_type_names[0];
else
- type_name = debug_type_names[idd.Type];
+ type_name = debug_type_names[idd.Type];
fprintf (file, " %2ld %14s %08lx %08lx %08lx\n",
idd.Type, type_name, idd.SizeOfData,
idd.AddressOfRawData, idd.PointerToRawData);
if (idd.Type == PE_IMAGE_DEBUG_TYPE_CODEVIEW)
- {
- char signature[CV_INFO_SIGNATURE_LENGTH * 2 + 1];
+ {
+ char signature[CV_INFO_SIGNATURE_LENGTH * 2 + 1];
/* PR 17512: file: 065-29434-0.001:0.1
We need to use a 32-bit aligned buffer
to safely read in a codeview record. */
- char buffer[256 + 1] ATTRIBUTE_ALIGNED_ALIGNOF (CODEVIEW_INFO);
+ char buffer[256 + 1] ATTRIBUTE_ALIGNED_ALIGNOF (CODEVIEW_INFO);
- CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
+ CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
- /* The debug entry doesn't have to have to be in a section,
+ /* The debug entry doesn't have to have to be in a section,
in which case AddressOfRawData is 0, so always use PointerToRawData. */
- if (!_bfd_XXi_slurp_codeview_record (abfd, (file_ptr) idd.PointerToRawData,
+ if (!_bfd_XXi_slurp_codeview_record (abfd, (file_ptr) idd.PointerToRawData,
idd.SizeOfData, cvinfo))
- continue;
+ continue;
- for (i = 0; i < cvinfo->SignatureLength; i++)
- sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff);
+ for (i = 0; i < cvinfo->SignatureLength; i++)
+ sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff);
/* xgettext:c-format */
- fprintf (file, _("(format %c%c%c%c signature %s age %ld)\n"),
+ fprintf (file, _("(format %c%c%c%c signature %s age %ld)\n"),
buffer[0], buffer[1], buffer[2], buffer[3],
signature, cvinfo->Age);
- }
+ }
}
if (size % sizeof (struct external_IMAGE_DEBUG_DIRECTORY) != 0)
fprintf (file,
- _("The debug directory size is not a multiple of the debug directory entry size\n"));
+ _("The debug directory size is not a multiple of the debug directory entry size\n"));
return TRUE;
}
@@ -2976,9 +2976,9 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
bfd_byte *data;
if (section && bfd_malloc_and_get_section (obfd, section, &data))
- {
- unsigned int i;
- struct external_IMAGE_DEBUG_DIRECTORY *dd =
+ {
+ unsigned int i;
+ struct external_IMAGE_DEBUG_DIRECTORY *dd =
(struct external_IMAGE_DEBUG_DIRECTORY *)(data + (addr - section->vma));
/* PR 17512: file: 0f15796a. */
@@ -2992,34 +2992,34 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
return FALSE;
}
- for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
+ for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
/ sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
- {
- asection *ddsection;
- struct external_IMAGE_DEBUG_DIRECTORY *edd = &(dd[i]);
- struct internal_IMAGE_DEBUG_DIRECTORY idd;
+ {
+ asection *ddsection;
+ struct external_IMAGE_DEBUG_DIRECTORY *edd = &(dd[i]);
+ struct internal_IMAGE_DEBUG_DIRECTORY idd;
- _bfd_XXi_swap_debugdir_in (obfd, edd, &idd);
+ _bfd_XXi_swap_debugdir_in (obfd, edd, &idd);
- if (idd.AddressOfRawData == 0)
- continue; /* RVA 0 means only offset is valid, not handled yet. */
+ if (idd.AddressOfRawData == 0)
+ continue; /* RVA 0 means only offset is valid, not handled yet. */
- ddsection = find_section_by_vma (obfd, idd.AddressOfRawData + ope->pe_opthdr.ImageBase);
- if (!ddsection)
- continue; /* Not in a section! */
+ ddsection = find_section_by_vma (obfd, idd.AddressOfRawData + ope->pe_opthdr.ImageBase);
+ if (!ddsection)
+ continue; /* Not in a section! */
- idd.PointerToRawData = ddsection->filepos + (idd.AddressOfRawData
+ idd.PointerToRawData = ddsection->filepos + (idd.AddressOfRawData
+ ope->pe_opthdr.ImageBase) - ddsection->vma;
- _bfd_XXi_swap_debugdir_out (obfd, &idd, edd);
- }
+ _bfd_XXi_swap_debugdir_out (obfd, &idd, edd);
+ }
- if (!bfd_set_section_contents (obfd, section, data, 0, section->size))
+ if (!bfd_set_section_contents (obfd, section, data, 0, section->size))
{
_bfd_error_handler (_("Failed to update file offsets in debug directory"));
return FALSE;
}
- }
+ }
else if (section)
{
_bfd_error_handler (_("%B: Failed to read debug data section"), obfd);
@@ -3101,12 +3101,12 @@ static bfd_byte *
rsrc_count_directory (bfd *, bfd_byte *, bfd_byte *, bfd_byte *, bfd_vma);
static bfd_byte *
-rsrc_count_entries (bfd * abfd,
- bfd_boolean is_name,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias)
+rsrc_count_entries (bfd * abfd,
+ bfd_boolean is_name,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias)
{
unsigned long entry, addr, size;
@@ -3154,11 +3154,11 @@ rsrc_count_entries (bfd * abfd,
}
static bfd_byte *
-rsrc_count_directory (bfd * abfd,
+rsrc_count_directory (bfd * abfd,
bfd_byte * datastart,
bfd_byte * data,
bfd_byte * dataend,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned int num_entries, num_ids;
bfd_byte * highest_data = data;
@@ -3190,7 +3190,7 @@ rsrc_count_directory (bfd * abfd,
typedef struct rsrc_dir_chain
{
- unsigned int num_entries;
+ unsigned int num_entries;
struct rsrc_entry * first_entry;
struct rsrc_entry * last_entry;
} rsrc_dir_chain;
@@ -3210,15 +3210,15 @@ typedef struct rsrc_directory
typedef struct rsrc_string
{
- unsigned int len;
- bfd_byte * string;
+ unsigned int len;
+ bfd_byte * string;
} rsrc_string;
typedef struct rsrc_leaf
{
- unsigned int size;
- unsigned int codepage;
- bfd_byte * data;
+ unsigned int size;
+ unsigned int codepage;
+ bfd_byte * data;
} rsrc_leaf;
typedef struct rsrc_entry
@@ -3226,18 +3226,18 @@ typedef struct rsrc_entry
bfd_boolean is_name;
union
{
- unsigned int id;
- struct rsrc_string name;
+ unsigned int id;
+ struct rsrc_string name;
} name_id;
bfd_boolean is_dir;
union
{
struct rsrc_directory * directory;
- struct rsrc_leaf * leaf;
+ struct rsrc_leaf * leaf;
} value;
- struct rsrc_entry * next_entry;
+ struct rsrc_entry * next_entry;
struct rsrc_directory * parent;
} rsrc_entry;
@@ -3246,13 +3246,13 @@ rsrc_parse_directory (bfd *, rsrc_directory *, bfd_byte *,
bfd_byte *, bfd_byte *, bfd_vma, rsrc_entry *);
static bfd_byte *
-rsrc_parse_entry (bfd * abfd,
- bfd_boolean is_name,
- rsrc_entry * entry,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias,
+rsrc_parse_entry (bfd * abfd,
+ bfd_boolean is_name,
+ rsrc_entry * entry,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
rsrc_directory * parent)
{
unsigned long val, addr, size;
@@ -3324,14 +3324,14 @@ rsrc_parse_entry (bfd * abfd,
}
static bfd_byte *
-rsrc_parse_entries (bfd * abfd,
+rsrc_parse_entries (bfd * abfd,
rsrc_dir_chain * chain,
- bfd_boolean is_name,
- bfd_byte * highest_data,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias,
+ bfd_boolean is_name,
+ bfd_byte * highest_data,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
rsrc_directory * parent)
{
unsigned int i;
@@ -3377,12 +3377,12 @@ rsrc_parse_entries (bfd * abfd,
}
static bfd_byte *
-rsrc_parse_directory (bfd * abfd,
+rsrc_parse_directory (bfd * abfd,
rsrc_directory * table,
bfd_byte * datastart,
bfd_byte * data,
bfd_byte * dataend,
- bfd_vma rva_bias,
+ bfd_vma rva_bias,
rsrc_entry * entry)
{
bfd_byte * highest_data = data;
@@ -3433,14 +3433,14 @@ rsrc_write_string (rsrc_write_data * data,
static inline unsigned int
rsrc_compute_rva (rsrc_write_data * data,
- bfd_byte * addr)
+ bfd_byte * addr)
{
return (addr - data->datastart) + data->rva_bias;
}
static void
rsrc_write_leaf (rsrc_write_data * data,
- rsrc_leaf * leaf)
+ rsrc_leaf * leaf)
{
bfd_put_32 (data->abfd, rsrc_compute_rva (data, data->next_data),
data->next_leaf);
@@ -3459,8 +3459,8 @@ static void rsrc_write_directory (rsrc_write_data *, rsrc_directory *);
static void
rsrc_write_entry (rsrc_write_data * data,
- bfd_byte * where,
- rsrc_entry * entry)
+ bfd_byte * where,
+ rsrc_entry * entry)
{
if (entry->is_name)
{
@@ -3588,19 +3588,19 @@ u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
if (c < 0xdc00)
{
if (n >= 2)
- {
- if (s[1] >= 0xdc00 && s[1] < 0xe000)
- {
- *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
- return 2;
- }
- }
+ {
+ if (s[1] >= 0xdc00 && s[1] < 0xe000)
+ {
+ *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
+ return 2;
+ }
+ }
else
- {
- /* Incomplete multibyte character. */
- *puc = 0xfffd;
- return n;
- }
+ {
+ /* Incomplete multibyte character. */
+ *puc = 0xfffd;
+ return n;
+ }
}
/* Invalid multibyte character. */
@@ -3725,7 +3725,7 @@ rsrc_resource_name (rsrc_entry * entry, rsrc_directory * dir)
case 1: strcat (buffer, " (CURSOR)"); break;
case 2: strcat (buffer, " (BITMAP)"); break;
case 3: strcat (buffer, " (ICON)"); break;
- case 4: strcat (buffer, " (MENU)"); break;
+ case 4: strcat (buffer, " (MENU)"); break;
case 5: strcat (buffer, " (DIALOG)"); break;
case 6: strcat (buffer, " (STRING)"); is_string = TRUE; break;
case 7: strcat (buffer, " (FONTDIR)"); break;
@@ -4133,22 +4133,22 @@ rsrc_process_section (bfd * abfd,
struct coff_final_link_info * pfinfo)
{
rsrc_directory new_table;
- bfd_size_type size;
- asection * sec;
+ bfd_size_type size;
+ asection * sec;
pe_data_type * pe;
- bfd_vma rva_bias;
- bfd_byte * data;
- bfd_byte * datastart;
- bfd_byte * dataend;
- bfd_byte * new_data;
- unsigned int num_resource_sets;
+ bfd_vma rva_bias;
+ bfd_byte * data;
+ bfd_byte * datastart;
+ bfd_byte * dataend;
+ bfd_byte * new_data;
+ unsigned int num_resource_sets;
rsrc_directory * type_tables;
rsrc_write_data write_data;
- unsigned int indx;
- bfd * input;
- unsigned int num_input_rsrc = 0;
- unsigned int max_num_input_rsrc = 4;
- ptrdiff_t * rsrc_sizes = NULL;
+ unsigned int indx;
+ bfd * input;
+ unsigned int num_input_rsrc = 0;
+ unsigned int max_num_input_rsrc = 4;
+ ptrdiff_t * rsrc_sizes = NULL;
new_table.names.num_entries = 0;
new_table.ids.num_entries = 0;
@@ -4277,9 +4277,9 @@ rsrc_process_section (bfd * abfd,
/* FIXME: Should we verify that all type tables are the same ? */
new_table.characteristics = type_tables[0].characteristics;
- new_table.time = type_tables[0].time;
- new_table.major = type_tables[0].major;
- new_table.minor = type_tables[0].minor;
+ new_table.time = type_tables[0].time;
+ new_table.major = type_tables[0].major;
+ new_table.minor = type_tables[0].minor;
/* Chain the NAME entries onto the table. */
new_table.names.first_entry = NULL;
@@ -4313,13 +4313,13 @@ rsrc_process_section (bfd * abfd,
if (new_data == NULL)
goto end;
- write_data.abfd = abfd;
- write_data.datastart = new_data;
- write_data.next_table = new_data;
- write_data.next_leaf = new_data + sizeof_tables_and_entries;
+ write_data.abfd = abfd;
+ write_data.datastart = new_data;
+ write_data.next_table = new_data;
+ write_data.next_leaf = new_data + sizeof_tables_and_entries;
write_data.next_string = write_data.next_leaf + sizeof_leaves;
- write_data.next_data = write_data.next_string + sizeof_strings;
- write_data.rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
+ write_data.next_data = write_data.next_string + sizeof_strings;
+ write_data.rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
rsrc_write_directory (& write_data, & new_table);
@@ -4398,7 +4398,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
}
/* The import address table. This is the size/address of
- .idata$5. */
+ .idata$5. */
h1 = coff_link_hash_lookup (coff_hash_table (info),
".idata$5", FALSE, FALSE, TRUE);
if (h1 != NULL
@@ -4479,7 +4479,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
" because .idata$6 is missing"), abfd);
result = FALSE;
}
- }
+ }
}
h1 = coff_link_hash_lookup (coff_hash_table (info),