]> sourceware.org Git - glibc.git/commitdiff
[ARM][BZ #17711] Fix extern protected data handling
authorSzabolcs Nagy <nsz@port70.net>
Fri, 24 Jul 2015 09:05:07 +0000 (10:05 +0100)
committerSzabolcs Nagy <nsz@port70.net>
Fri, 24 Jul 2015 09:05:07 +0000 (10:05 +0100)
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

ChangeLog
sysdeps/arm/dl-machine.h
sysdeps/arm/dl-sysdep.h

index ecce7f3273bc69c0b8e46ea54026d5c7ff5b09ee..6f6016db438e9cd5187b6487c5c0fc3b8693d2cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
        * sysdeps/aarch64/dl-sysdep.h (DL_EXTERN_PROTECTED_DATA): Define.
        * sysdeps/aarch64/dl-machine.h (elf_machine_type_class): Handle
        ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA.
+       * sysdeps/arm/dl-sysdep.h (DL_EXTERN_PROTECTED_DATA): Define.
+       * sysdeps/arm/dl-machine.h (elf_machine_type_class): Handle
+       ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA.
 
 2015-07-24  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
index f9015382554103bce84ea198eb509534eba74d14..6fb20bd747dc334e3ba0d77c326d23a4b1c271e1 100644 (file)
@@ -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.  */
index e5657ddf3ac62ef4546a3ce8f5330546a54aec39..463ce591b24eb8833342175ece191f12e357a414 100644 (file)
@@ -21,3 +21,5 @@
 /* _dl_argv cannot be attribute_relro, because _dl_start_user
    might write into it after _dl_start returns.  */
 #define DL_ARGV_NOT_RELRO 1
+
+#define DL_EXTERN_PROTECTED_DATA
This page took 0.112512 seconds and 5 git commands to generate.