aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-06 19:34:15 +1030
committerAlan Modra <amodra@gmail.com>2023-01-06 21:06:15 +1030
commit10df41b188b2692b6bc8c36d4003e0f8790d1f1b (patch)
tree8e35758d1b7208320c9808601492948b381be905 /bfd
parent22a95e1a37aff28238e9d40bbe4441aa554a14c6 (diff)
downloadgdb-10df41b188b2692b6bc8c36d4003e0f8790d1f1b.zip
gdb-10df41b188b2692b6bc8c36d4003e0f8790d1f1b.tar.gz
gdb-10df41b188b2692b6bc8c36d4003e0f8790d1f1b.tar.bz2
Tidy pe flag in coff_data
Make it a bool, use obj_pe accessor everywhere.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/coff-arm.c2
-rw-r--r--bfd/coff-mcore.c2
-rw-r--r--bfd/coffgen.c5
-rw-r--r--bfd/cofflink.c6
-rw-r--r--bfd/coffswap.h2
-rw-r--r--bfd/libcoff-in.h2
-rw-r--r--bfd/libcoff.h2
-rw-r--r--bfd/peicode.h2
8 files changed, 11 insertions, 12 deletions
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index c0b2b04..694ae8d 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -953,7 +953,7 @@ arm_emit_base_file_entry (struct bfd_link_info *info,
+ input_section->output_offset
+ input_section->output_section->vma);
- if (coff_data (output_bfd)->pe)
+ if (obj_pe (output_bfd))
addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
if (fwrite (&addr, sizeof (addr), 1, (FILE *) info->base_file) == 1)
return true;
diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c
index 561333d..e360d5e 100644
--- a/bfd/coff-mcore.c
+++ b/bfd/coff-mcore.c
@@ -220,7 +220,7 @@ mcore_emit_base_file_entry (struct bfd_link_info *info,
+ input_section->output_offset
+ input_section->output_section->vma;
- if (coff_data (output_bfd)->pe)
+ if (obj_pe (output_bfd))
addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
if (fwrite (&addr, sizeof (addr), 1, (FILE *) info->base_file) == 1)
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 74636a9..f21cf2c 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1826,8 +1826,7 @@ coff_get_normalized_symtab (bfd *abfd)
/* Ordinary short filename, put into memory anyway. The
Microsoft PE tools sometimes store a filename in
multiple AUX entries. */
- if (internal_ptr->u.syment.n_numaux > 1
- && coff_data (abfd)->pe)
+ if (internal_ptr->u.syment.n_numaux > 1 && obj_pe (abfd))
internal_ptr->u.syment._n._n_n._n_offset =
((uintptr_t)
copy_name (abfd,
@@ -1842,7 +1841,7 @@ coff_get_normalized_symtab (bfd *abfd)
}
/* Normalize other strings available in C_FILE aux entries. */
- if (!coff_data (abfd)->pe)
+ if (!obj_pe (abfd))
for (int numaux = 1; numaux < internal_ptr->u.syment.n_numaux; numaux++)
{
aux = internal_ptr + numaux + 1;
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index d6ccae4..0722688 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -1168,7 +1168,7 @@ _bfd_coff_final_link (bfd *abfd,
static char *
dores_com (char *ptr, bfd *output_bfd, int heap)
{
- if (coff_data(output_bfd)->pe)
+ if (obj_pe (output_bfd))
{
int val = strtoul (ptr, &ptr, 0);
@@ -1400,7 +1400,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
output_index = syment_base;
outsym = flaginfo->outsyms;
- if (coff_data (output_bfd)->pe
+ if (obj_pe (output_bfd)
&& ! process_embedded_commands (output_bfd, flaginfo->info, input_bfd))
return false;
@@ -3057,7 +3057,7 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
- input_section->vma
+ input_section->output_offset
+ input_section->output_section->vma);
- if (coff_data (output_bfd)->pe)
+ if (obj_pe (output_bfd))
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
if (fwrite (&addr, 1, sizeof (bfd_vma), (FILE *) info->base_file)
!= sizeof (bfd_vma))
diff --git a/bfd/coffswap.h b/bfd/coffswap.h
index e809dea..03f52bd 100644
--- a/bfd/coffswap.h
+++ b/bfd/coffswap.h
@@ -426,7 +426,7 @@ coff_swap_aux_in (bfd *abfd,
#if FILNMLEN != E_FILNMLEN
#error we need to cope with truncating or extending FILNMLEN
#else
- if (numaux > 1 && coff_data (abfd)->pe)
+ if (numaux > 1 && obj_pe (abfd))
{
if (indx == 0)
memcpy (in->x_file.x_n.x_fname, ext->x_file.x_fname,
diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h
index d27e5d4..a0d286d 100644
--- a/bfd/libcoff-in.h
+++ b/bfd/libcoff-in.h
@@ -101,7 +101,7 @@ typedef struct coff_tdata
bool go32;
/* Is this a PE format coff file? */
- int pe;
+ bool pe;
/* Copy of some of the f_flags bits in the COFF filehdr structure,
used by ARM code. */
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index f03330f..c2c1f4a 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -105,7 +105,7 @@ typedef struct coff_tdata
bool go32;
/* Is this a PE format coff file? */
- int pe;
+ bool pe;
/* Copy of some of the f_flags bits in the COFF filehdr structure,
used by ARM code. */
diff --git a/bfd/peicode.h b/bfd/peicode.h
index cc5a54e..06642c3 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -1090,7 +1090,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
if (bfd_coff_mkobject_hook (abfd, (void *) & internal_f, NULL) == NULL)
goto error_return;
- coff_data (abfd)->pe = 1;
+ obj_pe (abfd) = true;
#ifdef THUMBPEMAGIC
if (vars.magic == THUMBPEMAGIC)
/* Stop some linker warnings about thumb code not supporting interworking. */