[binutils-gdb] bfd: Add i386_pe_big_vec vector to win64 targets

Jan Beulich jbeulich@sourceware.org
Mon Sep 8 09:13:04 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5e3d14a179e42802cf81f0a405fd511f560c6dfe

commit 5e3d14a179e42802cf81f0a405fd511f560c6dfe
Author: Jeffrey Knockel <jeff@jeffreyknockel.com>
Date:   Mon Sep 8 11:10:25 2025 +0200

    bfd: Add i386_pe_big_vec vector to win64 targets
    
    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>

Diff:
---
 bfd/config.bfd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/config.bfd b/bfd/config.bfd
index a5c3953a18a..8448515d03a 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -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
     ;;


More information about the Binutils-cvs mailing list