mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
6fe014bcd3
When a wrapper symbol, __wrap_FOO, is defined in IR, its resolution should be LDPR_PREVAILING_DEF, not PREVAILING_DEF_IRONLY, since LTO doesn't know that __wrap_FOO provides definition of FOO. And resolution of FOO should be LDPR_RESOLVED_IR since it is resolved by __wrap_FOO in IR. PR ld/24406 * ld.texi: Remove LTO warning from --wrap. * plugin.c (get_symbols): Update resolution for wrapper and wrapped symbols. * testsuite/ld-plugin/lto.exp: Run ld/24406 tests. * testsuite/ld-plugin/pr24406-1.c: New file. * testsuite/ld-plugin/pr24406-2a.c: Likewise. * testsuite/ld-plugin/pr24406-2b.c: Likewise.
18 lines
222 B
C
18 lines
222 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
ssize_t
|
|
__wrap_read (int fd, void *buffer, size_t count)
|
|
{
|
|
puts ("PASS");
|
|
return fd + count + sizeof (buffer);
|
|
}
|
|
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int i = read (1, "abc", 5);
|
|
return i == 0;
|
|
}
|