mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
PE/COFF stores symbol section numbers in a 16-bit field. Binutils used signed 16-bit handling there, which limited normal PE objects to 32767 sections even though MSVC and Clang already accept a larger unsigned range. Raise the normal PE section limit to 65279, while keeping the PE/COFF special section-number values for undefined, absolute and debug symbols working correctly. Do this by decoding and encoding normal PE symbol section numbers as unsigned values in the ordinary range, but preserving the reserved PE constants explicitly. Also add a gas test that exercises a normal PE object above the old 32767-section limit and checks that objdump reports the high section number correctly. bfd/ChangeLog: * coffcode.h (COFF_DEFAULT_MAX_NSCNS): Define. (bfd_coff_std_swap_table): Use it for the default maximum section count. (ticoff0_swap_table): Likewise. (ticoff1_swap_table): Likewise. * peXXigen.c (pe_decode_sym_section_number): New function. (pe_encode_sym_section_number): New function. (_bfd_XXi_swap_sym_in): Use pe_decode_sym_section_number. (_bfd_XXi_swap_sym_out): Use pe_encode_sym_section_number. include/ChangeLog: * coff/pe.h (IMAGE_SYM_UNDEFINED): Define. (IMAGE_SYM_ABSOLUTE): Define. (IMAGE_SYM_DEBUG): Define. (IMAGE_SYM_SECTION_MAX): Define. gas/ChangeLog: * testsuite/gas/pe/pe.exp: Run large-obj-normal. * testsuite/gas/pe/large-obj-normal.s: New test. * testsuite/gas/pe/large-obj-normal.d: New test. Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com> |
||
|---|---|---|
| .. | ||
| aarch64.h | ||
| alpha.h | ||
| arm.h | ||
| ChangeLog-0415 | ||
| ChangeLog-9103 | ||
| ecoff.h | ||
| external.h | ||
| i386.h | ||
| ia64.h | ||
| internal.h | ||
| loongarch64.h | ||
| mcore.h | ||
| mips.h | ||
| msdos.h | ||
| pe.h | ||
| riscv64.h | ||
| rs6k64.h | ||
| rs6000.h | ||
| sh.h | ||
| sym.h | ||
| symconst.h | ||
| ti.h | ||
| tic4x.h | ||
| tic30.h | ||
| tic54x.h | ||
| x86.h | ||
| x86_64.h | ||
| xcoff.h | ||
| z8k.h | ||
| z80.h | ||