]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd: Add i386_pe_big_vec vector to win64 targets
authorJeffrey Knockel <jeff@jeffreyknockel.com>
Mon, 8 Sep 2025 09:10:25 +0000 (11:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Sep 2025 09:10:25 +0000 (11:10 +0200)
251dae91074170036c1a76c5e5df1f45197d7feb added i386_pe_big_vec to win32
targets but did not add it to win64 ones.

Adding i386_pe_big_vec vector to win64 targets fixes an issue where a
64-bit assembler on windows would fail to create bigobj files when
operating with 32-bit word size.  E.g., before this change, with a
64-bit toolchain:

$ echo 'int main(void) { return 100; }' \
| gcc -m32 -Wa,-mbig-obj -x c -c -o main.o -
$ objdump.exe -f main.o
main.o:     file format pe-i386
architecture: i386, flags 0x00000039:
HAS_RELOC, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x00000000

But after this change, the output file format is correctly bigobj:

$ echo 'int main(void) { return 100; }' \
| gcc -m32 -Wa,-mbig-obj -x c -c -o main.o -
$ objdump.exe -f main.o
main.o:     file format pe-bigobj-i386
architecture: i386, flags 0x0000003d:
HAS_RELOC, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS
start address 0x00000000

Although the above multilib compilation issue was the motivation for
this patch, this change has other positive consequences, such as
allowing the 64-bit windows build of objdump to disassemble
pe-bigobj-i386 format object files, etc.

Signed-off-by: Jeffrey Knockel <jeff@jeffreyknockel.com>
bfd/config.bfd

index a5c3953a18a97ea9e321048c078fc9d3dce1ec46..8448515d03a26c88885478e93e175e4bb73f46f1 100644 (file)
@@ -702,7 +702,7 @@ case "${targ}" in
     ;;
   x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep | x86_64-*-cygwin)
     targ_defvec=x86_64_pe_vec
-    targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_big_vec x86_64_elf64_vec i386_pe_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec pdb_vec"
+    targ_selvecs="x86_64_pe_vec x86_64_pei_vec x86_64_pe_big_vec x86_64_elf64_vec i386_pe_vec i386_pe_big_vec i386_pei_vec i386_elf32_vec iamcu_elf32_vec pdb_vec"
     want64=true
     targ_underscore=no
     ;;