binutils Newspaper
NOVEMBER 30, 2026
ld — Proposed

ld: add PE/COFF and XCOFF64 aux symbol overrun tests

Adds tests for linker symbol table bounds checking in PE/COFF and XCOFF64 formats.

This patch introduces new regression tests for linker symbol table bounds checking, specifically for PE/COFF and XCOFF64 formats. The tests cover malformed inputs that previously caused crashes or incorrect exits, as well as positive control cases. This work follows up on a previous commit that added similar tests for 32-bit XCOFF.

In the Thread 1 participant
  1. Harshit Kumar <harshit7kr@gmail.com> proposer

    Proposes adding new test cases to cover PE/COFF and XCOFF64 aux symbol overrun scenarios, building upon previous work for 32-bit XCOFF.

    “This patch adds regression test coverage for commit 335d76afde5. Commit 335d76afde5 validates symbol table bounds before the linker walks symbols in cofflink.c and xcofflink.c. The original commit added regression tests for 32-bit XCOFF only. This change adds 9 new tests (6 malformed and 3 positive controls), bringing the xcoff-aux and coff-aux tests to 16 in total:”

In Details

This patch adds test cases to ld/testsuite/ld-pe/coff-aux.exp and ld/testsuite/ld-powerpc/xcoff-aux.exp. It specifically targets the cofflink.c and xcofflink.c files within the linker, focusing on the validation of n_numaux fields in symbol table entries for PE/COFF and XCOFF64 object formats. The goal is to ensure that malformed symbol table data does not lead to crashes or incorrect linker behavior, as was addressed in commit 335d76afde5.

For Context
PE/COFF
Portable Executable/Common Object File Format, a file format used for executables, object code, and DLLs on 32-bit and 64-bit versions of Windows.
XCOFF
Extended Common Object File Format, an object file format used on AIX systems.
symbol table
A data structure used by a linker or debugger to store information about symbols (e.g., function names, variable names) defined in an object file or executable.
n_numaux
A field in the XCOFF symbol table entry that indicates the number of auxiliary entries associated with the symbol.
linker
A program that combines various pieces of code and data from object files into a single executable program.
Filed Under: linkertestingPE/COFFXCOFF