------- Comment #16 from jakub at gcc dot gnu dot org 2010-08-16 11:16 ------- Re: #c12, the difference is because the source code is different. In the first preprocessed source, restore_rt isn't hidden, in the latter it is. So, in the first case (-fPIE) gcc can't assume __restore_rt is defined in the same shared library or binary, in the latter case it can. Shorter testcase is: extern void foo (void) asm ("baz") #ifdef HIDDEN __attribute__((visibility ("hidden"))) #endif ; void *bar (void) { return &foo; } asm (".text; .type baz, @function; baz: nop; .previous");
-fpie vs. -fpic -DHIDDEN, the only difference is again: - movq b...@gotpcrel(%rip), %rax + leaq baz(%rip), %rax So, if there is any bug, it is either on the assembler/ld side, or on the glibc side or user side, compiling glibc in a way it was never meant to be compiled. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45286