[PATCH] bfd: Add i386_pe_big_vec vector to win64 targets
Jeffrey Knockel
jeff@jeffreyknockel.com
Tue Jul 22 13:36:26 GMT 2025
Ping! :)
On Fri, 2025-06-13 at 11:43 -0400, Jeffrey Knockel wrote:
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bfd/config.bfd b/bfd/config.bfd
> index 4e5a838fe4e..22d781802b4 100644
> --- a/bfd/config.bfd
> +++ b/bfd/config.bfd
> @@ -717,7 +717,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
mailing list