[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/31489] New: --as-needed doesn't work with references to builtin
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/31489] New: --as-needed doesn't work with references to builtin functions |
Date: |
Thu, 14 Mar 2024 17:30:11 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=31489
Bug ID: 31489
Summary: --as-needed doesn't work with references to builtin
functions
Product: binutils
Version: 2.43 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
GCC doesn't put builtin function symbol references, which are defined in
the shared C library, in the IR symbol table. As the result, --as-needed
doesn't work with references to builtin functions:
[hjl@gnu-cfl-3 as-needed]$ cat x.c
#include <stdlib.h>
int
main()
{
abort ();
return 0;
}
[hjl@gnu-cfl-3 as-needed]$ cat bar.c
#include <stdlib.h>
#include <stdio.h>
void
abort (void)
{
printf ("PASS\n");
exit (0);
}
[hjl@gnu-cfl-3 as-needed]$ make
gcc -B./ -g -flto -c -o x.o x.c
gcc -B./ -g -fPIC -c -o bar.o bar.c
gcc -B./ -shared -o libbar.so bar.o
gcc -B./ -Wl,--as-needed -o x x.o libbar.so -Wl,-R,.
./x
make: *** [Makefile:12: all] Aborted (core dumped)
[hjl@gnu-cfl-3 as-needed]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/31489] New: --as-needed doesn't work with references to builtin functions,
hjl.tools at gmail dot com <=