about summary refs log tree commit diff
path: root/sysdeps/arm/dl-machine.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2015-07-24 10:05:07 +0100
committerSzabolcs Nagy <nsz@port70.net>2015-07-24 10:05:07 +0100
commit3bcea719ddd6ce399d7bccb492c40af77d216e42 (patch)
tree11cb6c22b54b144e4b01e99c754ee0e7805c26c1 /sysdeps/arm/dl-machine.h
parent0910702c4d2cf9e8302b35c9519548726e1ac489 (diff)
downloadglibc-3bcea719ddd6ce399d7bccb492c40af77d216e42.tar.gz
glibc-3bcea719ddd6ce399d7bccb492c40af77d216e42.tar.xz
glibc-3bcea719ddd6ce399d7bccb492c40af77d216e42.zip
[ARM][BZ #17711] Fix extern protected data handling
Fixes elf/tst-protected1a and elf/tst-protected1b tests.

Depends on a gcc patch that makes protected visibility data non-local:
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01871.html
and on a binutils patch so R_*_GLOB_DAT relocs are used for it:
https://sourceware.org/ml/binutils/2015-07/msg00247.html
Diffstat (limited to 'sysdeps/arm/dl-machine.h')
-rw-r--r--sysdeps/arm/dl-machine.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index f901538255..6fb20bd747 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -224,18 +224,22 @@ _dl_start_user:\n\
    TLS variable, so undefined references should not be allowed to
    define the value.
    ELF_RTYPE_CLASS_COPY iff TYPE should not be allowed to resolve to one
-   of the main executable's symbols, as for a COPY reloc.  */
+   of the main executable's symbols, as for a COPY reloc.
+   ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA iff TYPE describes relocation against
+   protected data whose address may be external due to copy relocation.  */
 #ifndef RTLD_BOOTSTRAP
 # define elf_machine_type_class(type) \
   ((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32		\
      || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32	\
      || (type) == R_ARM_TLS_DESC)					\
     * ELF_RTYPE_CLASS_PLT)						\
-   | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY))
+   | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)			\
+   | (((type) == R_ARM_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
 #else
 #define elf_machine_type_class(type) \
   ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT)	\
-   | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY))
+   | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)	\
+   | (((type) == R_ARM_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
 #endif
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */