]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Compile gcrt1.o with -fPIC
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 23 Feb 2015 14:28:18 +0000 (06:28 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 23 Feb 2015 14:28:33 +0000 (06:28 -0800)
We compile gcrt1.o with -fPIC to support both "gcc -pg" and "gcc -pie -pg".

[BZ #17836]
* csu/Makefile (extra-objs): Add gmon-start.o if not builing
shared library.  Add gmon-start.os otherwise.
($(objpfx)g$(start-installed-name)): Use $(objpfx)S%
$(objpfx)gmon-start.os if builing shared library.
($(objpfx)g$(static-start-installed-name)): Likewise.

ChangeLog
NEWS
csu/Makefile

index 82299e5ebe21fbebc76da7d2f2085f84041a1fda..0a059097e40d35e95e504302f6e7bcc096578aa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #17836]
+       * csu/Makefile (extra-objs): Add gmon-start.o if not builing
+       shared library.  Add gmon-start.os otherwise.
+       ($(objpfx)g$(start-installed-name)): Use $(objpfx)S%
+       $(objpfx)gmon-start.os if builing shared library.
+       ($(objpfx)g$(static-start-installed-name)): Likewise.
+
 2015-02-23  Andreas Schwab  <schwab@suse.de>
 
        * elf/Makefile (CFLAGS-tst-audit2.c): Define.
diff --git a/NEWS b/NEWS
index 28ef45da550f7b10fbf6e30603dcb226d1c498de..e5d8ee8834ae0c87011cce2c5a53d7ab569788ce 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,8 @@ Version 2.22
 * The following bugs are resolved with this release:
 
   4719, 13064, 14094, 15319, 15467, 15790, 16560, 17269, 17569, 17588,
-  17792, 17912, 17932, 17944, 17949, 17964, 17965, 17967, 17969, 17978,
-  17987, 17991, 17996, 17998, 17999.
+  17792, 17836, 17912, 17932, 17944, 17949, 17964, 17965, 17967, 17969,
+  17978, 17987, 17991, 17996, 17998, 17999.
 
 * Character encoding and ctype tables were updated to Unicode 7.0.0, using
   new generator scripts contributed by Pravin Satpute and Mike FABIAN (Red
index f7cf4af3d1c9f0c2f9983cff48ce814e61efcc65..9f0855a6ac55c00a48dcdbb091f613fbfb76c7b2 100644 (file)
@@ -32,7 +32,7 @@ aux    = errno
 elide-routines.os = libc-tls
 static-only-routines = elf-init
 csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o)
-extra-objs = start.o gmon-start.o \
+extra-objs = start.o \
             $(start-installed-name) g$(start-installed-name) $(csu-dummies) \
             S$(start-installed-name)
 omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
@@ -46,9 +46,11 @@ tests := tst-empty tst-atomic tst-atomic-long
 tests-static := tst-empty
 
 ifeq (yes,$(build-shared))
-extra-objs += S$(start-installed-name)
+extra-objs += S$(start-installed-name) gmon-start.os
 install-lib += S$(start-installed-name)
 generated += start.os
+else
+extra-objs += gmon-start.o
 endif
 
 ifneq ($(start-installed-name),$(static-start-installed-name))
@@ -95,10 +97,17 @@ endif
 # The profiling startfile is made by linking together the normal
 # startfile with gmon-start.o, which defines a constructor function
 # to turn on profiling code at startup.
+ifeq (yes,$(build-shared))
+$(addprefix $(objpfx),$(sort g$(start-installed-name) \
+                            g$(static-start-installed-name))): \
+  $(objpfx)g%: $(objpfx)S% $(objpfx)gmon-start.os
+       $(link-relocatable)
+else
 $(addprefix $(objpfx),$(sort g$(start-installed-name) \
                             g$(static-start-installed-name))): \
   $(objpfx)g%: $(objpfx)% $(objpfx)gmon-start.o
        $(link-relocatable)
+endif
 
 # These extra files are sometimes expected by system standard linking
 # procedures, but we have nothing for them to do.  So compile empty files.