TEXTREL issue

Hi,

We have an issue with TEXTRELs. Is it compiler bug?

$ cat foo.c
extern int foo(int i);
int foo(int i){
return i+i;
}

$ pgcc -V

pgcc 11.10-0 64-bit target on x86-64 Linux -tp nehalem
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved.

$ pgcc -c -fPIC foo.c

$ ld -shared foo.o -o libfoo.so

$ readelf -a libfoo.so | grep TEXTREL
0x0000000000000016 (TEXTREL) 0x0

$ eu-findtextrel libfoo.so
the file containing the function ‘’ might not be compiled with -fpic/-fPIC

Thanks,
Vladimir

Hi Vladimir,

It looks like our stack tracing support is getting in your way. Try adding “–nodebugframe” to see if it works around your issue.

Hope this helps,
Mat

Hi Mat,

Maybe I misunderstand something:

$ pgcc -c -fPIC --nodebugframe foo.c ; ld -shared foo.o -o libfoo.so ; readelf -a libfoo.so | grep TEXTREL
pgcc-Error-Unknown switch: --nodebugframe
0x0000000000000016 (TEXTREL) 0x0

$ pgcc -c -fPIC -notraceback foo.c ; ld -shared foo.o -o libfoo.so ; readelf -a libfoo.so | grep TEXTREL
0x0000000000000016 (TEXTREL) 0x0


Thanks,
Vladimir

Hi Vladimir,

My apologies. I failed to test using an release compiler. The “–nodebugframe” named flag is only enabled in our internal development compiler.

Instead you can use the internal compiler flag “-Mx,120,0x400” to disable the debug frame used for stack trace support.

I have submitted a problem report (TPR#18140) and asked our engineers to investigate a more permanent fix.

Thanks,
Mat

Hi Mat,

I’ve checked the test, the option is really solves the issue. Will try to build the whole project.

Thanks,
Vladimir