Bug 22264

Summary: Check PIC instead of SHARED for PIC code path
Product: glibc Reporter: H.J. Lu <hjl.tools>
Component: libcAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: normal CC: drepper.fsp
Priority: P2 Flags: fweimer: security-
Version: 2.27   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description H.J. Lu 2017-10-05 12:50:56 UTC
SHARED is checked in:

sysdeps/arm/__longjmp.S:#  ifdef SHARED
sysdeps/arm/dl-tlsdesc.S:#ifdef SHARED
sysdeps/arm/dl-tlsdesc.S:#endif /* SHARED */
sysdeps/arm/setjmp.S:#  ifdef SHARED
sysdeps/ia64/fpu/e_exp2f.S:#ifdef SHARED
sysdeps/ia64/fpu/e_expf.S:#ifdef SHARED
sysdeps/ia64/fpu/e_log2f.S:#ifdef SHARED
sysdeps/ia64/fpu/e_logf.S:#ifdef SHARED
sysdeps/ia64/fpu/e_powf.S:#ifdef SHARED
sysdeps/ia64/fpu/e_powl.S:POWL_64_SHARED:
sysdeps/microblaze/_mcount.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/a2/memcpy.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S:#  ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_ceil.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_ceilf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_floor.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_floorf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_lround.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_rint.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_rintf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_round.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_round.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_roundf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_roundf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_trunc.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/s_truncf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/fpu/setjmp-common.S:#  ifdef SHARED
sysdeps/powerpc/powerpc32/memset.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power4/multiarch/strchr-ppc32.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S:#ifdef SHARED
sysdeps/powerpc/powerpc32/power7/strcasecmp.S:# ifdef SHARED
sysdeps/powerpc/powerpc32/power7/strcasecmp.S:# endif /* SHARED */
sysdeps/powerpc/powerpc32/ppc-mcount.S:#ifndef SHARED
sysdeps/powerpc/powerpc64/__longjmp-common.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/__longjmp-common.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/dl-trampoline.S:#ifndef SHARED
sysdeps/powerpc/powerpc64/dl-trampoline.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/dl-trampoline.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/dl-trampoline.S:#ifndef SHARED
sysdeps/powerpc/powerpc64/dl-trampoline.S:#ifndef SHARED
sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S:#ifdef SHARED
sysdeps/powerpc/powerpc64/power7/strncpy.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power7/strstr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power7/strstr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power7/strstr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power8/strcasestr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power8/strcasestr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power8/strcasestr.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/power8/strncpy.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/ppc-mcount.S:#ifndef SHARED
sysdeps/powerpc/powerpc64/setjmp-common.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/setjmp-common.S:# ifdef SHARED
sysdeps/powerpc/powerpc64/setjmp-common.S:#elif defined SHARED
sysdeps/sh/_mcount.S:#ifdef SHARED
sysdeps/sh/_mcount.S:#ifdef SHARED
sysdeps/sh/bsd-_setjmp.S:#ifdef SHARED
sysdeps/sh/bsd-setjmp.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/dl-trampoline.S:#ifdef SHARED
sysdeps/sh/sh3/setjmp.S:# ifdef SHARED
sysdeps/sh/sh4/setjmp.S:# ifdef SHARED
sysdeps/sparc/sparc64/cpu_relax.S:# ifdef SHARED
sysdeps/sparc/sparc64/cpu_relax.S:# ifdef SHARED
sysdeps/sparc/sparc64/cpu_relax.S:# ifdef SHARED
sysdeps/sparc/sparc64/cpu_relax.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/add_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/add_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/add_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/add_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/addmul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/addmul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/addmul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/addmul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memcpy.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/memset.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/mul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/mul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/mul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/mul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/sub_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/sub_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/sub_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/sub_n.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/submul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/submul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/submul_1.S:# ifdef SHARED
sysdeps/sparc/sparc64/multiarch/submul_1.S:# ifdef SHARED
sysdeps/unix/sh/sysdep.S:#ifndef SHARED
sysdeps/unix/sh/sysdep.S:#ifndef SHARED
sysdeps/unix/sysv/linux/m68k/m68k-helpers.S:# ifdef SHARED
sysdeps/unix/sysv/linux/m68k/m68k-helpers.S:# else /* !SHARED */
sysdeps/unix/sysv/linux/m68k/m68k-helpers.S:# endif /* SHARED */
sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S:#   ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S:# ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:#  ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:#   ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S:#ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S:# ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S:#ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S:#ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S:# ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S:# ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S:#ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S:# ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S:#ifdef SHARED
sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S:# ifdef SHARED

If SHARED is checked to select PIC code path, it should be changed to
check PIC to support static PIE.
Comment 1 joseph@codesourcery.com 2017-10-05 16:04:03 UTC
None of the ARM files listed look like they should be testing for PIC.