From 34d6a3cbf2be45aa039a7eb9f0084a4b710437b8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 17 Aug 2017 04:55:44 -0700 Subject: Support mcount/gprof test with GCC defaulting to PIE The mcount/gprof test should be linked with gcrt1.o, not Scrt1.o. * Makeconfig (+link-pie-before-libc): Add CRT-* hook to override the startup object. --- Makeconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makeconfig') diff --git a/Makeconfig b/Makeconfig index 5f24691..b51904b 100644 --- a/Makeconfig +++ b/Makeconfig @@ -409,7 +409,7 @@ ifndef +link-pie +link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ - $(addprefix $(csu-objpfx),S$(start-installed-name)) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \ $(+preinit) $(+prectorS) \ $(filter-out $(addprefix $(csu-objpfx),start.o \ S$(start-installed-name))\ -- cgit v1.1