[PATCH] memset: fix define usage for shared libs

Mike Frysinger vapier@gentoo.org
Thu Apr 5 03:00:00 GMT 2012


On Wednesday 04 April 2012 21:47:36 David Miller wrote:
> From: Mike Frysinger <vapier@gentoo.org>
> > On Wednesday 04 April 2012 21:32:11 David Miller wrote:
> >> From: Mike Frysinger <vapier@gentoo.org>
> >> 
> >> > The proper define to check "am I in a shared lib" is "SHARED", not
> >> > "PIC". The two new memset_chk functions incorrectly depend on "PIC".
> >> 
> >> I'm ambivalent on this one, because there are other locations
> >> where we essentially test libc.a vs. libc.so using PIC too.
> > 
> > where ?  i'll fix them.  we (Gentoo) notice fairly quickly because our
> > hardened systems build everything as PIC/PIE.  ChromeOS too.
> 
> sysdeps/unix/sysv/linux/i386/sysdep.S, for example.
> 
> Perhaps that situation is different, but at least the comment even
> talks about shared vs. non-shared.

the code matches the sysdep.h logic.  either is correct, it's just a matter of 
optimization i think.  the static/non-PIC code has one syscall_error which 
references errno directly and other syscalls jump to, but the shared/PIC 
inlines things.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120405/e085f600/attachment.sig>


More information about the Libc-alpha mailing list