This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/17711] copy relocations against protected symbols don't work
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 07 Mar 2015 14:26:36 +0000
- Subject: [Bug dynamic-link/17711] copy relocations against protected symbols don't work
- Auto-submitted: auto-generated
- References: <bug-17711-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17711
--- Comment #19 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/pr17841/master has been created
at 25de905e5c9280002501af20ac4836795ae8146f (commit)
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=25de905e5c9280002501af20ac4836795ae8146f
commit 25de905e5c9280002501af20ac4836795ae8146f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Mar 2 14:53:11 2015 -0800
Compile archives with -fno-pie
When compiler defaults to PIE, we compile archives with -fno-pie. Since
archives won't be used with PIE, compile them with -fpie isn't necessary.
[BZ #17841]
* Makeconfig (no-pie-ccflag): New. Set to -fno-pie.
(pic-default): Don't define if $(no-pie-ccflag) is -fno-pie.
(test-object-suffix): New.
* Makerules (archive-objects): New. Set before including
extra-lib.mk.
($(archive-objects)): New. New rule to append $(no-pie-ccflag)
to CFLAGS.
* extra-lib.mk (archive-objects): New.
* crypt/Makefile ($(objpfx)md5test): Replace ".o" with
$(test-object-suffix).
($(objpfx)md5test-giant): Likewise.
($(objpfx)sha256test): Likewise.
($(objpfx)sha512test): Likewise.
* math/Makefile (LDFLAGS-atest-exp): New.
(LDFLAGS-atest-sincos): Likewise.
(LDFLAGS-atest-exp2): Likewise.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=01181d5beae0edc4cb7abbc8bb94098a2bea2366
commit 01181d5beae0edc4cb7abbc8bb94098a2bea2366
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jan 14 06:29:04 2015 -0800
Support compilers defaulting to PIE
If PIE is the default, we need to build programs as PIE.
[BZ #17841]
* Makeconfig (no-pie-ldflag): New.
(+link): Set to $(+link-pie) if default to PIE.
(+link-tests): Set to $(+link-pie-tests) if default to PIE.
* config.make.in (build-pie-default): New.
* configure.ac (libc_cv_pie_default): New. Set to yes if -fPIE
is default. AC_SUBST.
* configure: Regenerated.
* elf/Makefile (LDFLAGS-tst-dlopen-aout): New.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4ba31feb73f4f700d93e7005e50bdb4835839623
commit 4ba31feb73f4f700d93e7005e50bdb4835839623
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Mar 5 11:36:35 2015 -0800
Add a testcase for copy reloc against protected data
Linkers in some versions of binutils 2.25 and 2.26 don't support protected
data symbol with error messsage like:
/usr/bin/ld: copy reloc against protected `bar' is invalid
/usr/bin/ld: failed to set dynamic section sizes: Bad value
We check if linker supports copy reloc against protected data symbol to
avoid running the test if linker is broken.
[BZ #17711]
* config.make.in (have-protected-data): New.
* configure.ac: Check linker support for protected data symbol.
* configure: Regenerated.
* elf/Makefile (modules-names): Add tst-protected1moda and
tst-protected1modb if $(have-protected-data) is yes.
(tests): Add tst-protected1a and tst-protected1b if
$(have-protected-data) is yes.
($(objpfx)tst-protected1a): New.
($(objpfx)tst-protected1b): Likewise.
(tst-protected1modb.so-no-z-defs): Likewise.
* elf/tst-protected1a.c: New file.
* elf/tst-protected1b.c: Likewise.
* elf/tst-protected1mod.h: Likewise.
* elf/tst-protected1moda.c: Likewise.
* elf/tst-protected1modb.c: Likewise.
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6df34771a51884b8cfdc8216e9d07883979ebf84
commit 6df34771a51884b8cfdc8216e9d07883979ebf84
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Mar 4 10:24:25 2015 -0800
Add ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA to x86
With copy relocation, address of protected data defined in the shared
library may be external. When there is a relocation against the
protected data symbol within the shared library, we need to check if we
should skip the definition in the executable copied from the protected
data. This patch adds ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA and defines
it for x86. If ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA isn't 0, do_lookup_x
will skip the data definition in the executable from copy reloc.
[BZ #17711]
* elf/dl-lookup.c (do_lookup_x): When UNDEF_MAP is NULL, which
indicates it is called from do_lookup_x on relocation against
protected data, skip the data definion in the executable from
copy reloc.
(_dl_lookup_symbol_x): Pass ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA,
instead of ELF_RTYPE_CLASS_PLT, to do_lookup_x for
EXTERN_PROTECTED_DATA relocation against STT_OBJECT symbol.
* sysdeps/generic/ldsodefs.h * (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA):
New. Defined to 4 if DL_EXTERN_PROTECTED_DATA is defined,
otherwise to 0.
* sysdeps/i386/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
* sysdeps/i386/dl-machine.h (elf_machine_type_class): Set class
to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_386_GLOB_DAT.
* sysdeps/x86_64/dl-lookupcfg.h (DL_EXTERN_PROTECTED_DATA): New.
* sysdeps/x86_64/dl-machine.h (elf_machine_type_class): Set class
to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA for R_X86_64_GLOB_DAT.
-----------------------------------------------------------------------
--
You are receiving this mail because:
You are on the CC list for the bug.