aboutsummaryrefslogtreecommitdiff
path: root/gas
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 /gas
parent1eb399142793d31d1b7a358baad5fded996e02eb (diff)
downloadfsf-binutils-gdb-251dae91074170036c1a76c5e5df1f45197d7feb.zip
fsf-binutils-gdb-251dae91074170036c1a76c5e5df1f45197d7feb.tar.gz
fsf-binutils-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 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/NEWS2
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/doc/c-i386.texi3
-rw-r--r--gas/testsuite/gas/pe/big-obj.d2
-rw-r--r--gas/testsuite/gas/pe/pe.exp3
6 files changed, 15 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index eeeb17d..8cbe5ec 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-27 Tamar Christina <tamar.christina@arm.com>
+
+ * 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.
+
2020-04-27 Nick Clifton <nickc@redhat.com>
PR 25878
diff --git a/gas/NEWS b/gas/NEWS
index 58d79ca..815359b 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -13,6 +13,8 @@
(if such output is being generated). Added the ability to generate
version 5 .debug_line sections.
+* Add -mbig-obj support to i386 MingW targets.
+
Changes in 2.34:
* Add -malign-branch-boundary=NUM, -malign-branch=TYPE[+TYPE...],
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index a692c45..32fd6c1 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -13506,7 +13506,7 @@ i386_target_format (void)
if (flag_code == CODE_64BIT)
return use_big_obj ? "pe-bigobj-x86-64" : "pe-x86-64";
else
- return "pe-i386";
+ return use_big_obj ? "pe-bigobj-i386" : "pe-i386";
# elif defined (TE_GO32)
case bfd_target_coff_flavour:
return "coff-go32";
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 4acece4..551512f 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -390,9 +390,10 @@ with default visibility can be preempted. The resulting code is
slightly bigger. This option only affects the handling of branch
instructions.
+@cindex @samp{-mbig-obj} option, i386
@cindex @samp{-mbig-obj} option, x86-64
@item -mbig-obj
-On x86-64 PE/COFF target this option forces the use of big object file
+On PE/COFF target this option forces the use of big object file
format, which allows more than 32768 sections.
@cindex @samp{-momit-lock-prefix=} option, i386
diff --git a/gas/testsuite/gas/pe/big-obj.d b/gas/testsuite/gas/pe/big-obj.d
index 95ff1d8..27b351a 100644
--- a/gas/testsuite/gas/pe/big-obj.d
+++ b/gas/testsuite/gas/pe/big-obj.d
@@ -1,6 +1,6 @@
#as: -mbig-obj
#objdump: -h
-#name: PE x64 big obj
+#name: PE big obj
.*: *file format pe-bigobj-.*
diff --git a/gas/testsuite/gas/pe/pe.exp b/gas/testsuite/gas/pe/pe.exp
index e213213..76345ba 100644
--- a/gas/testsuite/gas/pe/pe.exp
+++ b/gas/testsuite/gas/pe/pe.exp
@@ -55,7 +55,6 @@ if ([istarget "x86_64-*-mingw*"]) then {
# Big obj
-if ([istarget "x86_64-*-mingw*"]) then {
- # Currently only supported on x86_64
+if ([istarget "*-*-mingw*"]) then {
run_dump_test "big-obj"
}