Summary: | invalid relocation R_386_GOTOFF when using protected function pointers | ||
---|---|---|---|
Product: | gcc | Reporter: | Gernot Hillier, Siemens CT SE 2 <gernot.hillier> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | 3b87w8mt2n, gcc-bugs, jay.krell |
Priority: | P3 | ||
Version: | 4.3.2 | ||
Target Milestone: | --- | ||
See Also: |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19520 https://sourceware.org/bugzilla/show_bug.cgi?id=28875 https://sourceware.org/bugzilla/show_bug.cgi?id=28877 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 |
||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | ||
Bug Depends on: | 35513 | ||
Bug Blocks: | |||
Attachments: |
C file showing the problem
preprocessed version of the code triggering the bug |
Description
Gernot Hillier, Siemens CT SE 2
2008-09-22 07:16:39 UTC
Created attachment 16375 [details]
C file showing the problem
See the body of f1 for the two cases. Using "f3( f2)" triggers the problem while "f3 (x)" works.
Created attachment 16376 [details]
preprocessed version of the code triggering the bug
As a data point, this occurs for me with GCC 4.3.4 (Debian 4.3.4-6) on AMD64 (x86_64), compiling the given test file as C: $ gcc -c -o test2.o test2.c && gcc -shared -o test2.so test2.o /usr/bin/ld: test2.o: relocation R_X86_64_32 against `f2' can not be used when making a shared object; recompile with -fPIC test2.o: could not read symbols: Bad value collect2: ld returned 1 exit status Er, sorry, that's the message from the wrong run. Here's the right one: $ gcc -fPIC -c -o test2.o test2.c && gcc -shared -o test2.so test2.o /usr/bin/ld: test2.o: relocation R_X86_64_PC32 against protected symbol `f2' can not be used when making a shared object /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status Function pointer != function address in shared library. "f2" is protected and the one defined in shared library will be called. But its function pointer can be out side of shared library. That is why R_X86_64_PC32 can't be used. This bug can be fixed if PR 35513 is resolved. |