From: Fangrui Song Date: Sat, 25 Jun 2022 17:27:49 +0000 (-0700) Subject: arm: Define elf_backend_extern_protected_data to 0 [PR 18705] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af9bf9cb4703909caf6e66a9f746bdd66a74f633;p=binutils-gdb.git arm: Define elf_backend_extern_protected_data to 0 [PR 18705] Similar to commit 4fb55bf6a9606eb7b626c30a9f4e71d6c2d4fbb2 for aarch64. Commit b68a20d6675f1360ea4db50a9835c073675b9889 changed ld to produce R_ARM_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. --- diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 60f89ec6117..0852b38ae4c 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -20315,7 +20315,7 @@ elf32_arm_backend_symbol_processing (bfd *abfd, asymbol *sym) #define elf_backend_dtrel_excludes_plt 1 #define elf_backend_got_header_size 12 -#define elf_backend_extern_protected_data 1 +#define elf_backend_extern_protected_data 0 #undef elf_backend_obj_attrs_vendor #define elf_backend_obj_attrs_vendor "aeabi" diff --git a/ld/testsuite/ld-arm/protected-data.d b/ld/testsuite/ld-arm/protected-data.d index 3f266dea1b4..7dffe9ab958 100644 --- a/ld/testsuite/ld-arm/protected-data.d +++ b/ld/testsuite/ld-arm/protected-data.d @@ -2,4 +2,4 @@ #ld: -shared #readelf: -r -W #... -.* R_ARM_GLOB_DAT .* var.* +.* R_ARM_RELATIVE .*