diff mbox

[nios2] Extern protected data definitions

Message ID 55B4D2B6.8000903@codesourcery.com
State New
Headers show

Commit Message

Chung-Lin Tang July 26, 2015, 12:29 p.m. UTC
Like the additions for ARM/aarch64, this fixes the elf/tst-protected1[ab]
tests on Nios II.  It does require a single liner patch to BFD to
define 'elf_backend_extern_protected_data', which I'll submit to upstream soon.

Tested and committed to master.

This should be the last fix I have for Nios II for 2.22, I'll be posting
the test results to the release wiki page soon.

Thanks,
Chung-Lin

2015-07-26  Chung-Lin Tang  <cltang@codesourcery.com>

        * sysdeps/nios2/dl-sysdep.h (DL_EXTERN_PROTECTED_DATA): Define.
        * sysdeps/nios2/dl-machine.h (elf_machine_type_class): Handle
        ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA.
diff mbox

Patch

diff --git a/sysdeps/nios2/dl-machine.h b/sysdeps/nios2/dl-machine.h
index 1a8397f..10ec821 100644
--- a/sysdeps/nios2/dl-machine.h
+++ b/sysdeps/nios2/dl-machine.h
@@ -193,7 +193,8 @@  _start:\n\
      || (type) == R_NIOS2_TLS_DTPMOD				\
      || (type) == R_NIOS2_TLS_DTPREL				\
      || (type) == R_NIOS2_TLS_TPREL) * ELF_RTYPE_CLASS_PLT)	\
-   | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY))
+   | (((type) == R_NIOS2_COPY) * ELF_RTYPE_CLASS_COPY)		\
+   | (((type) == R_NIOS2_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
 
 /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
 #define ELF_MACHINE_JMP_SLOT  R_NIOS2_JUMP_SLOT
diff --git a/sysdeps/nios2/dl-sysdep.h b/sysdeps/nios2/dl-sysdep.h
index 4f49c2d..ef6d3f3 100644
--- a/sysdeps/nios2/dl-sysdep.h
+++ b/sysdeps/nios2/dl-sysdep.h
@@ -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