Re: [PATCH] ld: testsuite: Fix test cases in ld-unique/unique.exp.

Jan Beulich <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
On 16.08.2026 17:26, Jan Dubiec wrote:
> These tests fail on H8, as shown in the log below, for two reasons:
>   1. Unexpected assembler diagnostics (see also https://sourceware.org/pipermail/binutils/2026-August/150723.html).
>   2. An undefined reference to main: unique.s defines main, whereas the C
>   startup code expects _main.
> 
> This patch fixes both issues.
> 
> /J.D.
> 
> 
> [...]
> Running /mnt/Works/binutils/ld/testsuite/ld-unique/unique.exp ...
> FAIL: Could not create a non-unique object
> FAIL: Could not link a unique executable
> [...]
> 
> 
> Detailed log:
> [...]
> h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/ -I/mnt/Works/binutils/ld/testsuite/ld-unique -g -O2 -fno-sanitize=all    -c  -c /mnt/Works/binutils/ld/testsuite/ld-unique/unique.s -o tmpdir/unique.o
> Executing on host: sh -c {h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/ -I/mnt/Works/binutils/ld/testsuite/ld-unique -g -O2 -fno-sanitize=all    -c  -c /mnt/Works/binutils/ld/testsuite/ld-unique/unique.s -o tmpdir/unique.o 2>&1}  /dev/null ld.tmp (timeout = 300)
> spawn [open ...]
> h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/ -I/mnt/Works/binutils/ld/testsuite/ld-unique -g -O2 -fno-sanitize=all    -c  -c /mnt/Works/binutils/ld/testsuite/ld-unique/unique_empty.s -o tmpdir/unique_empty.o
> Executing on host: sh -c {h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/ -I/mnt/Works/binutils/ld/testsuite/ld-unique -g -O2 -fno-sanitize=all    -c  -c /mnt/Works/binutils/ld/testsuite/ld-unique/unique_empty.s -o tmpdir/unique_empty.o 2>&1}  /dev/null ld.tmp (timeout = 300)
> spawn [open ...]
> /mnt/Works/binutils/ld/testsuite/ld-unique/unique_empty.s: Assembler messages:
> /mnt/Works/binutils/ld/testsuite/ld-unique/unique_empty.s:6: Warning: new section '.note.GNU-stack' defined without attributes - this might cause problems
> /mnt/Works/binutils/ld/testsuite/ld-unique/unique_empty.s:6: Warning: new section '.note.GNU-stack' defined without attributes - this might cause problems
> 
> FAIL: Could not create a non-unique object
> h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/  -no-pie  -L/usr/local/h8300-elf/lib      -L/mnt/Works/xcomp/build-binutils-h8300-linux/ld -o tmpdir/unique_prog tmpdir/unique.o
> Executing on host: sh -c {h8300-elf-cc  -B/mnt/Works/xcomp/build-binutils-h8300-linux/ld/tmpdir/ld/  -no-pie  -L/usr/local/h8300-elf/lib      -L/mnt/Works/xcomp/build-binutils-h8300-linux/ld -o tmpdir/unique_prog tmpdir/unique.o 2>&1}  /dev/null ld.tmp (timeout = 300)
> spawn [open ...]
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: warning: /mnt/Works/xcomp/sysroot-linux/bin/../lib/gcc/h8300-elf/17.0.0/crtn.o: missing .note.GNU-stack section implies executable stack
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: /mnt/Works/xcomp/sysroot-linux/bin/../lib/gcc/h8300-elf/17.0.0/../../../../h8300-elf/lib/crt0.o: in function `start':
> (.text+0x29): undefined reference to `main'
> collect2: error: ld returned 1 exit status
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: warning: /mnt/Works/xcomp/sysroot-linux/bin/../lib/gcc/h8300-elf/17.0.0/crtn.o: missing .note.GNU-stack section implies executable stack
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
> /mnt/Works/xcomp/sysroot-linux/h8300-elf/bin/ld: /mnt/Works/xcomp/sysroot-linux/bin/../lib/gcc/h8300-elf/17.0.0/../../../../h8300-elf/lib/crt0.o: in function `start':
> (.text+0x29): undefined reference to `main'
> collect2: error: ld returned 1 exit status
> 
> FAIL: Could not link a unique executable
> [...]
> 
> Signed-off-by: Jan Dubiec <[email protected]>
> ---
>  ld/testsuite/ld-unique/unique.s        | 5 +++--
>  ld/testsuite/ld-unique/unique_empty.s  | 2 +-
>  ld/testsuite/ld-unique/unique_shared.s | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)

Looks okay to me. I'll see about getting this in later in the week.

Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.