[uClibc-cvs] svn commit: trunk/uClibc: extra/Configs libc/sysdeps/linux/arm

jocke at uclibc.org jocke at uclibc.org
Thu May 26 21:23:04 UTC 2005


Author: jocke
Date: 2005-05-26 15:23:03 -0600 (Thu, 26 May 2005)
New Revision: 10411

Log:
Add PIE support to ARM. From Peter Mazinger


Modified:
   trunk/uClibc/extra/Configs/Config.in
   trunk/uClibc/libc/sysdeps/linux/arm/Makefile


Changeset:
Modified: trunk/uClibc/extra/Configs/Config.in
===================================================================
--- trunk/uClibc/extra/Configs/Config.in	2005-05-26 21:10:13 UTC (rev 10410)
+++ trunk/uClibc/extra/Configs/Config.in	2005-05-26 21:23:03 UTC (rev 10411)
@@ -1110,12 +1110,12 @@
 	bool "Build utilities as ET_DYN/PIE executables"
 	depends on UCLIBC_SECURITY
 	depends on HAVE_SHARED
-	depends on TARGET_i386 || TARGET_powerpc || TARGET_mips || TARGET_frv
+	depends on TARGET_arm || TARGET_frv || TARGET_i386 || TARGET_mips || TARGET_powerpc
 	select FORCE_SHAREABLE_TEXT_SEGMENTS if BUILD_UCLIBC_LDSO
 	default y
 	help
 	  If you answer Y here, ldd and iconv are built as ET_DYN/PIE executables.
-	  It requires gcc-3.4 and binutils-2.15 or later.
+	  It requires gcc-3.4 and binutils-2.15 (for arm 2.16) or later.
 	  More about ET_DYN/PIE binaries on <http://pax.grsecurity.net/> .
 	  WARNING: This option also enables FORCE_SHAREABLE_TEXT_SEGMENTS, so all
 		libraries have to be built with -fPIC or -fpic, and all assembler

Modified: trunk/uClibc/libc/sysdeps/linux/arm/Makefile
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/Makefile	2005-05-26 21:10:13 UTC (rev 10410)
+++ trunk/uClibc/libc/sysdeps/linux/arm/Makefile	2005-05-26 21:23:03 UTC (rev 10411)
@@ -21,7 +21,7 @@
 
 CRT0_SRC = crt0.S
 CRT0_OBJ = crt0.o crt1.o
-CRT0_DEPS=gmon-start.S
+SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
 CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
 
 SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
@@ -37,15 +37,24 @@
 
 all: $(OBJ_LIST)
 
-$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
+$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
 	echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
 	$(INSTALL) -d $(TOPDIR)lib/
-	cp $(CRT0_OBJ) $(TOPDIR)lib/
+	cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
+	$(RM) $(TOPDIR)lib/Scrt0.o
+else
+	mv $(TOPDIR)lib/Scrt0.o $(TOPDIR)lib/Scrt1.o
+endif
 
 $(CRT0_OBJ): $(CRT0_SRC)
 	$(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
+$(SCRT0_OBJ): $(CRT0_SRC)
+	$(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
+	$(STRIPTOOL) -x -R .note -R .comment $*.o
+
 $(SOBJS): %.o : %.S
 	$(CC) $(ASFLAGS) -c $< -o $@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
@@ -83,4 +92,3 @@
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
-	$(RM) gmon-start.S




More information about the uClibc-cvs mailing list