mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
Explicitly remove .gnu.glibc-stub sections with objcopy when not using
linker script.
This commit is contained in:
parent
f781ef4015
commit
1b74661a6b
@ -1,5 +1,14 @@
|
|||||||
2011-07-02 Roland McGrath <roland@hack.frob.com>
|
2011-07-02 Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
|
* Makerules [shlib-lds-flags empty]:
|
||||||
|
($(common-objpfx)libc_pic.opts): New target.
|
||||||
|
($(common-objpfx)libc_pic.os.clean): New target.
|
||||||
|
($(common-objpfx)libc.so): Link it instead of libc_pic.os.
|
||||||
|
|
||||||
|
* config.make.in (OBJCOPY): New variable.
|
||||||
|
* aclocal.m4 (LIBC_PROG_BINUTILS): Substitute OBJCOPY too.
|
||||||
|
* configure: Regenerated.
|
||||||
|
|
||||||
* config.make.in (use-default-link): New variable.
|
* config.make.in (use-default-link): New variable.
|
||||||
* configure.in (use_default_link): Grok --with-default-link to set it.
|
* configure.in (use_default_link): Grok --with-default-link to set it.
|
||||||
* configure: Regenerated.
|
* configure: Regenerated.
|
||||||
|
21
Makerules
21
Makerules
@ -621,10 +621,27 @@ endif
|
|||||||
ifeq ($(elf),yes)
|
ifeq ($(elf),yes)
|
||||||
$(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
|
$(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
|
||||||
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
|
$(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.
|
# Use our own special initializer and finalizer files for libc.so.
|
||||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
|
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
|
||||||
$(common-objpfx)libc_pic.os \
|
$(common-objpfx)libc_pic.os$(libc_pic_clean) \
|
||||||
$(elfobjdir)/sofini.os \
|
$(elfobjdir)/sofini.os \
|
||||||
$(elfobjdir)/interp.os $(elfobjdir)/ld.so \
|
$(elfobjdir)/interp.os $(elfobjdir)/ld.so \
|
||||||
$(shlib-lds)
|
$(shlib-lds)
|
||||||
|
2
aclocal.m4
vendored
2
aclocal.m4
vendored
@ -101,6 +101,8 @@ AR=`$CC -print-prog-name=ar`
|
|||||||
AC_SUBST(AR)
|
AC_SUBST(AR)
|
||||||
OBJDUMP=`$CC -print-prog-name=objdump`
|
OBJDUMP=`$CC -print-prog-name=objdump`
|
||||||
AC_SUBST(OBJDUMP)
|
AC_SUBST(OBJDUMP)
|
||||||
|
OBJCOPY=`$CC -print-prog-name=objcopy`
|
||||||
|
AC_SUBST(OBJCOPY)
|
||||||
|
|
||||||
# Determine whether we are using GNU binutils.
|
# Determine whether we are using GNU binutils.
|
||||||
AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
|
AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
|
||||||
|
@ -116,6 +116,7 @@ PWD_P = @PWD_P@
|
|||||||
BISON = @BISON@
|
BISON = @BISON@
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
OBJDUMP = @OBJDUMP@
|
OBJDUMP = @OBJDUMP@
|
||||||
|
OBJCOPY = @OBJCOPY@
|
||||||
|
|
||||||
# Installation tools.
|
# Installation tools.
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
|
3
configure
vendored
3
configure
vendored
@ -677,6 +677,7 @@ PWD_P
|
|||||||
LD
|
LD
|
||||||
AS
|
AS
|
||||||
MIG
|
MIG
|
||||||
|
OBJCOPY
|
||||||
OBJDUMP
|
OBJDUMP
|
||||||
AR
|
AR
|
||||||
LN_S
|
LN_S
|
||||||
@ -4686,6 +4687,8 @@ AR=`$CC -print-prog-name=ar`
|
|||||||
|
|
||||||
OBJDUMP=`$CC -print-prog-name=objdump`
|
OBJDUMP=`$CC -print-prog-name=objdump`
|
||||||
|
|
||||||
|
OBJCOPY=`$CC -print-prog-name=objcopy`
|
||||||
|
|
||||||
|
|
||||||
# Determine whether we are using GNU binutils.
|
# Determine whether we are using GNU binutils.
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $AS is GNU as" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $AS is GNU as" >&5
|
||||||
|
Loading…
Reference in New Issue
Block a user