aarch64: Define elf_backend_extern_protected_data to 0 [PR 18705]
authorFangrui Song <maskray@google.com>
Thu, 23 Jun 2022 08:04:39 +0000 (01:04 -0700)
committerFangrui Song <i@maskray.me>
Thu, 23 Jun 2022 08:04:39 +0000 (01:04 -0700)
Follow-up to commit 90b7a5df152a64d2bea20beb438e8b81049a5c30
("aarch64: Disallow copy relocations on protected data").

Commit 32f573bcb3aaa1c9defcad79dbb5851fcc02ae2d changed ld to produce
R_AARCH64_GLOB_DAT but that defeated the purpose of protected visibility
as an optimization.  Restore the previous behavior (which matches
ld.lld) by defining elf_backend_extern_protected_data to 0.

bfd/elfnn-aarch64.c
ld/testsuite/ld-aarch64/protected-data.d

index 81311fc5a329b5b435592e3ac4d5a1a9d110b308..ce2632ecd3015175d66eb088bd8b71900dc2feba 100644 (file)
@@ -10116,7 +10116,7 @@ const struct elf_size_info elfNN_aarch64_size_info =
 #define elf_backend_dtrel_excludes_plt 1
 #define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
 #define elf_backend_default_execstack  0
-#define elf_backend_extern_protected_data 1
+#define elf_backend_extern_protected_data 0
 #define elf_backend_hash_symbol elf_aarch64_hash_symbol
 
 #undef elf_backend_obj_attrs_section
index 5dabf04748ce20105a8cb7d6a729fb5683f8b382..ee9b4cfc6b54261f01ad857fc195e0c15d4219e3 100644 (file)
@@ -2,4 +2,4 @@
 #ld: -shared
 #readelf: -r -W
 #...
-.* R_AARCH64_GLOB_DAT .* var.*
+.* R_AARCH64_RELATIVE .*