about summary refs log tree commit diff
path: root/elf/testobj6.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-03-31 05:15:43 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-03-31 17:17:42 -0700
commitc5cd4843e79d71c2776eac3602ced23ab4e4b8d0 (patch)
treec5435e74b033b52b8cf6dd8171a32c60d3ae1a35 /elf/testobj6.c
parent262365511f6fafa4e15090fe16a295c03c6f6c5e (diff)
downloadglibc-c5cd4843e79d71c2776eac3602ced23ab4e4b8d0.tar.gz
glibc-c5cd4843e79d71c2776eac3602ced23ab4e4b8d0.tar.xz
glibc-c5cd4843e79d71c2776eac3602ced23ab4e4b8d0.zip
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.

Cherry-pick from master: 62da1e3b00b51383ffa7efc89d8addda0502e107
	[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.
Diffstat (limited to 'elf/testobj6.c')
0 files changed, 0 insertions, 0 deletions