On 01/12/15 12:29, H.J. Lu wrote:
Is this an inherent restriction of -fPIE, or is it merely an implementation
detail? If the latter, is that implementation detail a target issue? ie,
could we have a target that supports profiling in conjunction with -fPIE?
If so, then this test seems too restrictive.
[hjl@gnu-6 tmp]$ gcc -pie -fPIE -pg h.c
/usr/local/bin/ld:
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/gcrt1.o:
relocation R_X86_64_32S against `__libc_csu_fini' can not be used when
making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/gcrt1.o:
error adding symbols: Bad value
collect2: error: ld returned 1 exit status
[hjl@gnu-6 tmp]$
There is no crt1.o from glibc to support -pg -pie -fPIE.
I don't know if other targets support -pie -fPIE.
Can you please investigate the questions. Showing me the link failure
doesn't really help much here. It tells me there's no crt1.o, but it
says nothing about *why*.
Is there inherently something about PIE/pg that makes them impossible to
work together or is this an implementation detail? If the latter, then
is the implementation detail a target issue or not.
Jeff