This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: detecting non-PIC in shared lib on Darwin?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: howarth at bromo dot msbb dot uc dot edu (Jack Howarth)
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 26 Apr 2006 21:32:50 -0400 (EDT)
- Subject: Re: detecting non-PIC in shared lib on Darwin?
>
> I recall that the Debian folks proposed a method of detecting non-PIC
> code in their shared libs using...
>
> readelf -d foo.so | grep TEXTREL
>
> Does anyone know if some mechanism like this is possible for Darwin
> shared libraries? I ask because we just discovered that the gmp developers
> have been building non-PIC code (due to the usage of -fast without -fPIC)
> in the MacOS X builds. It would be nice to be able to check for the non-PIC
> code in all the shared libs on MacOS X. Thanks in advance for any info.
This is offtopic.
Also this is hard to do in a target dependent way. Anyways the linker for
darwin should have rejected this case anyways. Report this as a bug
to Apple.
-- pinski