aboutsummaryrefslogtreecommitdiff
path: root/bfd/pe-x86_64.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2020-04-27 17:39:31 +0100
committerTamar Christina <tamar.christina@arm.com>2020-04-27 17:41:39 +0100
commit251dae91074170036c1a76c5e5df1f45197d7feb (patch)
tree4abe10293202aa8c6cb536b82fa91034e8ef8f9d /bfd/pe-x86_64.c
parent1eb399142793d31d1b7a358baad5fded996e02eb (diff)
downloadgdb-251dae91074170036c1a76c5e5df1f45197d7feb.zip
gdb-251dae91074170036c1a76c5e5df1f45197d7feb.tar.gz
gdb-251dae91074170036c1a76c5e5df1f45197d7feb.tar.bz2
x86: Add i386 PE big-object support
The 64-bit version of binutils got support for the PE COFF BIG OBJ format a couple of years ago. The BIG OBJ format is a slightly different COFF format which extends the size of the number of section field in the header from a uint16_t to a uint32_t and so greatly increases the number of sections allowed. However the 32-bit version of bfd never got support for this. The GHC Haskell compiler generates a great deal of symbols due to it's use of -ffunction-sections and -fdata-sections. This meant that we could not build the 32-bit version of the GHC Compiler for many releases now as binutils didn't have this support. This patch adds the support to the 32-bit port of binutils as well and also does come cleanup in the code. bfd/ChangeLog: * coff-i386.c (COFF_WITH_PE_BIGOBJ): New. * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New. * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec to x86_64_pe_big_vec as it not a big-endian format. (vec i386_pe_big_vec): New. * configure.ac: Likewise. * targets.c: Likewise. * configure: Regenerate. * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG, COFF_WITH_PE_BIGOBJ): New. * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG): New. (x86_64_pe_be_vec): Moved. gas/ChangeLog: * NEWS: Add news entry for big-obj. * config/tc-i386.c (i386_target_format): Support new format. * doc/c-i386.texi: Add i386 support. * testsuite/gas/pe/big-obj.d: Rename test to not be x64 specific. * testsuite/gas/pe/pe.exp (big-obj): Make test run on i386 as well. ld/ChangeLog: * pe-dll.c (pe_detail_list): Add pe-bigobj-i386.
Diffstat (limited to 'bfd/pe-x86_64.c')
-rw-r--r--bfd/pe-x86_64.c66
1 files changed, 2 insertions, 64 deletions
diff --git a/bfd/pe-x86_64.c b/bfd/pe-x86_64.c
index 12d29e4f..1c38329 100644
--- a/bfd/pe-x86_64.c
+++ b/bfd/pe-x86_64.c
@@ -25,6 +25,8 @@
#define TARGET_SYM x86_64_pe_vec
#define TARGET_NAME "pe-x86-64"
+#define TARGET_SYM_BIG x86_64_pe_big_vec
+#define TARGET_NAME_BIG "pe-bigobj-x86-64"
#define COFF_WITH_PE
#define COFF_WITH_pex64
#define COFF_WITH_PE_BIGOBJ
@@ -66,67 +68,3 @@ extern bfd_boolean pex64_bfd_print_pdata (bfd *, void *);
#include "coff-x86_64.c"
-/* Entry for big object files. */
-
-const bfd_target
-x86_64_pe_be_vec =
-{
- "pe-bigobj-x86-64", /* Name. */
- bfd_target_coff_flavour,
- BFD_ENDIAN_LITTLE, /* Data byte order is little. */
- BFD_ENDIAN_LITTLE, /* Header byte order is little. */
-
- (HAS_RELOC | EXEC_P /* Object flags. */
- | HAS_LINENO | HAS_DEBUG
- | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS),
-
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */
- | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING
- | SEC_CODE | SEC_DATA | SEC_EXCLUDE ),
-
- TARGET_UNDERSCORE, /* Leading underscore. */
- '/', /* Ar_pad_char. */
- 15, /* Ar_max_namelen. */
- 0, /* match priority. */
-
- bfd_getl64, bfd_getl_signed_64, bfd_putl64,
- bfd_getl32, bfd_getl_signed_32, bfd_putl32,
- bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data. */
- bfd_getl64, bfd_getl_signed_64, bfd_putl64,
- bfd_getl32, bfd_getl_signed_32, bfd_putl32,
- bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */
-
- /* Note that we allow an object file to be treated as a core file as well. */
- { /* bfd_check_format. */
- _bfd_dummy_target,
- amd64coff_object_p,
- bfd_generic_archive_p,
- amd64coff_object_p
- },
- { /* bfd_set_format. */
- _bfd_bool_bfd_false_error,
- coff_mkobject,
- _bfd_generic_mkarchive,
- _bfd_bool_bfd_false_error
- },
- { /* bfd_write_contents. */
- _bfd_bool_bfd_false_error,
- coff_write_object_contents,
- _bfd_write_archive_contents,
- _bfd_bool_bfd_false_error
- },
-
- BFD_JUMP_TABLE_GENERIC (coff),
- BFD_JUMP_TABLE_COPY (coff),
- BFD_JUMP_TABLE_CORE (_bfd_nocore),
- BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
- BFD_JUMP_TABLE_SYMBOLS (coff),
- BFD_JUMP_TABLE_RELOCS (coff),
- BFD_JUMP_TABLE_WRITE (coff),
- BFD_JUMP_TABLE_LINK (coff),
- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
- NULL,
-
- &bigobj_swap_table
-};