diff options
author | Roland McGrath <roland@hack.frob.com> | 2011-06-25 00:06:42 -0700 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2011-07-02 15:21:27 -0700 |
commit | 1b74661a6b93a892ecb1c717dedeedba5c2a976c (patch) | |
tree | 56bd14f4f2ea8e15e03fc80c8044ba96fbfa5514 /Makerules | |
parent | f781ef4015504e8a1da649c266584976238aa079 (diff) | |
download | glibc-1b74661a6b93a892ecb1c717dedeedba5c2a976c.tar.gz |
Explicitly remove .gnu.glibc-stub sections with objcopy when not using
linker script.
Diffstat (limited to 'Makerules')
-rw-r--r-- | Makerules | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -621,10 +621,27 @@ endif ifeq ($(elf),yes) $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a $(LINK.o) -nostdlib -nostartfiles -r -o $@ \ - $(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^ + $(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^ -o $@ + +ifeq (,$(strip $(shlib-lds-flags))) +# Generate a list of -R options to excise .gnu.glibc-stub.* sections. +$(common-objpfx)libc_pic.opts: $(common-objpfx)libc_pic.os + $(OBJDUMP) -h $< | \ + $(AWK) '$$2 ~ /\.gnu\.glibc-stub\./ { print "-R", $$2 }' \ + > $@T + mv -f $@T $@ +# Apply those -R options. +$(common-objpfx)libc_pic.os.clean: $(common-objpfx)libc_pic.opts \ + $(common-objpfx)libc_pic.os + $(OBJCOPY) @$^ $@ +generated += libc_pic.opts libc_pic.os.clean + +libc_pic_clean := .clean +endif + # Use our own special initializer and finalizer files for libc.so. $(common-objpfx)libc.so: $(elfobjdir)/soinit.os \ - $(common-objpfx)libc_pic.os \ + $(common-objpfx)libc_pic.os$(libc_pic_clean) \ $(elfobjdir)/sofini.os \ $(elfobjdir)/interp.os $(elfobjdir)/ld.so \ $(shlib-lds) |