[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/5789] New: Linker doesn't check weak and hidden symbols
From: |
hjl dot tools at gmail dot com |
Subject: |
[Bug ld/5789] New: Linker doesn't check weak and hidden symbols |
Date: |
23 Feb 2008 23:07:30 -0000 |
bash-3.2$ cat x.c
extern void foo() __attribute__((weak,visibility("hidden")));
extern int puts( char const* );
int main()
{
foo ? foo() : puts( "foo == null, skipped." );
return 0;
}
bash-3.2$ /usr/gcc-4.4/bin/gcc -B./ -fPIC -g -c -o x.o x.c
bash-3.2$ ./ld -shared -o libx.so x.o
./ld: x.o: relocation R_X86_64_PC32 against `foo' can not be used when making a
shared object; recompile with -fPIC
./ld: final link failed: Bad value
bash-3.2$ /usr/gcc-4.4/bin/gcc -B./ -fPIC -g -c -o x.o x.c -m32
bash-3.2$ ld -m elf_i386 -shared -o libx.so x.o
bash-3.2$
Linker should issue clear error message for both cases.
--
Summary: Linker doesn't check weak and hidden symbols
Product: binutils
Version: 2.19 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hjl dot tools at gmail dot com
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=5789
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/5789] New: Linker doesn't check weak and hidden symbols,
hjl dot tools at gmail dot com <=