Revert "Add extern_protected_data and set it for x86"
authorAlan Modra <amodra@gmail.com>
Thu, 9 Apr 2015 12:06:24 +0000 (21:36 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 10 Apr 2015 09:46:47 +0000 (19:16 +0930)
This reverts commit ca3fe95e469b9daec153caa2c90665f5daaec2b5.

21 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf32-i386.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfxx-target.h
ld/testsuite/ChangeLog
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pr17709-nacl.rd [deleted file]
ld/testsuite/ld-i386/pr17709.rd [deleted file]
ld/testsuite/ld-i386/pr17709a.s [deleted file]
ld/testsuite/ld-i386/pr17709b.s [deleted file]
ld/testsuite/ld-i386/protected3.d
ld/testsuite/ld-i386/protected3.s
ld/testsuite/ld-x86-64/pr17709-nacl.rd [deleted file]
ld/testsuite/ld-x86-64/pr17709.rd [deleted file]
ld/testsuite/ld-x86-64/pr17709a.s [deleted file]
ld/testsuite/ld-x86-64/pr17709b.s [deleted file]
ld/testsuite/ld-x86-64/protected3.d
ld/testsuite/ld-x86-64/protected3.s
ld/testsuite/ld-x86-64/x86-64.exp

index 95cf8d7f537d7879c8997d730154a16bbcfa0241..f1d93435223a2e6e983648e9cd3d630f039c6f3d 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-10  Alan Modra  <amodra@gmail.com>
+
+       Revert 2015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
+       PR ld/pr15228
+       PR ld/pr17709
+       * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
+       * elf32-i386.c (elf_backend_extern_protected_data): Delete.
+       * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
+       * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
+       extern_protected_data test.
+       (_bfd_elf_symbol_refs_local_p): Likewise.
+       * elfxx-target.h (elf_backend_extern_protected_data): Delete.
+       (elfNN_bed): Delete elf_backend_extern_protected_data init.
+
 2015-04-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * compress.c (bfd_compress_section_contents): Update comments.
index e435e52cc02802529d4326f3a3a064060f6b4142..8def41b92a568588593d06b7e42d81e39e480f4d 100644 (file)
@@ -1363,10 +1363,6 @@ struct elf_backend_data
      in length rather than sec->size in length, if sec->rawsize is
      non-zero and smaller than sec->size.  */
   unsigned caches_rawsize : 1;
-
-  /* Address of protected data defined in the shared library may be
-     external, i.e., due to copy relocation.   */
-  unsigned extern_protected_data : 1;
 };
 
 /* Information about reloc sections associated with a bfd_elf_section_data
index 52f4d3343c6315ec0c8a32047ca1344cbc577d5f..3f16fc1013b97a861c7699f9fb68d9757c8bbf50 100644 (file)
@@ -5292,7 +5292,6 @@ elf_i386_add_symbol_hook (bfd * abfd,
 #define elf_backend_want_plt_sym       0
 #define elf_backend_got_header_size    12
 #define elf_backend_plt_alignment      4
-#define elf_backend_extern_protected_data 1
 
 /* Support RELA for objdump of prelink objects.  */
 #define elf_info_to_howto                    elf_i386_info_to_howto_rel
index ab72306bca5704cb875b91c161d7c076f1524845..6eb84718a51be227f9ad1080a4f2463722e78f08 100644 (file)
@@ -5868,7 +5868,6 @@ static const struct bfd_elf_special_section
 #define elf_backend_got_header_size        (GOT_ENTRY_SIZE*3)
 #define elf_backend_rela_normal                    1
 #define elf_backend_plt_alignment           4
-#define elf_backend_extern_protected_data   1
 
 #define elf_info_to_howto                  elf_x86_64_info_to_howto
 
index 022a5353bf784ab30ee0852e58c6861114a702ca..183b313e3f4abfa5f6f67d30fa569f451f35e022 100644 (file)
@@ -2673,9 +2673,7 @@ _bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info,
   /* Increment the size of DYNBSS to make room for the symbol.  */
   dynbss->size += h->size;
 
-  /* No error if extern_protected_data is true.  */
-  if (h->protected_def
-      && !get_elf_backend_data (dynbss->owner)->extern_protected_data)
+  if (h->protected_def)
     {
       info->callbacks->einfo
        (_("%P: copy reloc against protected `%T' is invalid\n"),
@@ -2839,9 +2837,8 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
 
   bed = get_elf_backend_data (hash_table->dynobj);
 
-  /* If extern_protected_data is false, STV_PROTECTED non-function
-     symbols are local.  */
-  if (!bed->extern_protected_data && !bed->is_function_type (h->type))
+  /* STV_PROTECTED non-function symbols are local.  */
+  if (!bed->is_function_type (h->type))
     return TRUE;
 
   /* Function pointer equality tests may require that STV_PROTECTED
index 0085d6ccc278a1430242412fb20ec4399a04ade6..9bfb6c857715daa50dbe70c148f0bd19679af637 100644 (file)
 #ifndef elf_backend_caches_rawsize
 #define elf_backend_caches_rawsize 0
 #endif
-#ifndef elf_backend_extern_protected_data
-#define elf_backend_extern_protected_data 0
-#endif
 #ifndef elf_backend_stack_align
 #define elf_backend_stack_align 16
 #endif
@@ -809,8 +806,7 @@ static struct elf_backend_data elfNN_bed =
   elf_backend_want_dynbss,
   elf_backend_want_p_paddr_set_to_zero,
   elf_backend_default_execstack,
-  elf_backend_caches_rawsize,
-  elf_backend_extern_protected_data
+  elf_backend_caches_rawsize
 };
 
 /* Forward declaration for use when initialising alternative_target field.  */
index cfa22f4ce459c7ae3b10e59c953ee57709c4e905..8811a864b0b462a62e1b6898c9647d8ca86edf6d 100644 (file)
@@ -1,3 +1,23 @@
+2015-04-10  Alan Modra  <amodra@gmail.com>
+
+       Revert 2015-03-05  H.J. Lu  <hongjiu.lu@intel.com>
+       PR ld/pr15228
+       PR ld/pr17709
+       * ld-i386/i386.exp (i386tests): Remove test for PR ld/17709.
+       * ld-i386/pr17709-nacl.rd: Delete.
+       * ld-i386/pr17709.rd: Likewise.
+       * ld-i386/pr17709a.s: Likewise.
+       * ld-i386/pr17709b.s: Likewise.
+       * ld-i386/protected3.d: Updated.
+       * ld-i386/protected3.s: Likewise.
+       * ld-x86-64/pr17709-nacl.rd: Delete.
+       * ld-x86-64/pr17709.rd: Likewise.
+       * ld-x86-64/pr17709a.s: Likewise.
+       * ld-x86-64/pr17709b.s: Likewise.
+       * ld-x86-64/protected3.d: Updated.
+       * ld-x86-64/protected3.s: Likewise.
+       * ld-x86-64/x86-64.exp (x86_64tests): Remove test for PR ld/17709.
+
 2015-04-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * ld-elf/compress.exp: Add a test for
index 3fdd39ca20ba93a91673505acd5b4c9c2676d13a..4fc2359879977c8ba8d4a5ffb99afbd276e719d4 100644 (file)
@@ -191,10 +191,6 @@ set i386tests {
      "--32" {pr17306b.s} {} ""}
     {"PR ld/17306 (2)" "-melf_i386 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
      "--32" {pr17306a.s} {} "libpr17306.so"}
-    {"PR ld/17709 (1)" "-melf_i386 -shared" ""
-     "--32" {pr17709a.s} {} "libpr17709.so"}
-    {"PR ld/17709 (2)" "-melf_i386 tmpdir/libpr17709.so" ""
-     "--32" {pr17709b.s} {{readelf -r pr17709.rd}} "pr17709"}
 }
 
 # So as to avoid rewriting every last test case here in a nacl variant,
diff --git a/ld/testsuite/ld-i386/pr17709-nacl.rd b/ld/testsuite/ld-i386/pr17709-nacl.rd
deleted file mode 100644 (file)
index ac9d174..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Relocation section '.rel\..*' at offset .* contains 1 entries:
- Offset     Info    Type            Sym\.Value  Sym\. Name
-[0-9a-f ]+R_386_COPY +[0-9a-f]+ +foo
diff --git a/ld/testsuite/ld-i386/pr17709.rd b/ld/testsuite/ld-i386/pr17709.rd
deleted file mode 100644 (file)
index ac9d174..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Relocation section '.rel\..*' at offset .* contains 1 entries:
- Offset     Info    Type            Sym\.Value  Sym\. Name
-[0-9a-f ]+R_386_COPY +[0-9a-f]+ +foo
diff --git a/ld/testsuite/ld-i386/pr17709a.s b/ld/testsuite/ld-i386/pr17709a.s
deleted file mode 100644 (file)
index 8750f5e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-       .protected      foo
-.globl foo
-       .data
-       .align 4
-       .type   foo, @object
-       .size   foo, 4
-foo:
-       .long   1
diff --git a/ld/testsuite/ld-i386/pr17709b.s b/ld/testsuite/ld-i386/pr17709b.s
deleted file mode 100644 (file)
index c57f404..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-       .text
-       .globl  _start
-       .type   _start, @function
-_start:
-       movl    foo, %eax
index 47ab4e1a9e9a7234981320b39041520be8fc730e..aafa2d81b350c259be120a7f6bfd466489857e64 100644 (file)
@@ -8,7 +8,6 @@
 Disassembly of section .text:
 
 0+[a-f0-9]+ <bar>:
-[      ]*[a-f0-9]+:    8b 81 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] ff ff           mov    -0x[a-f0-9]+\(%ecx\),%eax
-[      ]*[a-f0-9]+:    8b 00                   mov    \(%eax\),%eax
+[      ]*[a-f0-9]+:    8b 81 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] 00 00           mov    0x[a-f0-9]+\(%ecx\),%eax
 [      ]*[a-f0-9]+:    c3                      ret    
 #pass
index 4dd21154d90074cfab07b4b38a26faa6dfa8f37a..7a605a2929a9e3256157b494eabb42de6157ac26 100644 (file)
@@ -10,7 +10,6 @@ foo:
 .globl bar
        .type   bar, @function
 bar:
-       movl    foo@GOT(%ecx), %eax
-       movl    (%eax), %eax
+       movl    foo@GOTOFF(%ecx), %eax
        ret
        .size   bar, .-bar
diff --git a/ld/testsuite/ld-x86-64/pr17709-nacl.rd b/ld/testsuite/ld-x86-64/pr17709-nacl.rd
deleted file mode 100644 (file)
index f1baa38..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Relocation section '.rela\..*' at offset .* contains 1 entries:
- +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-[0-9a-f ]+R_X86_64_COPY+[0-9a-f ]+ +foo \+ 0
diff --git a/ld/testsuite/ld-x86-64/pr17709.rd b/ld/testsuite/ld-x86-64/pr17709.rd
deleted file mode 100644 (file)
index f1baa38..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Relocation section '.rela\..*' at offset .* contains 1 entries:
- +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
-[0-9a-f ]+R_X86_64_COPY+[0-9a-f ]+ +foo \+ 0
diff --git a/ld/testsuite/ld-x86-64/pr17709a.s b/ld/testsuite/ld-x86-64/pr17709a.s
deleted file mode 100644 (file)
index 8750f5e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-       .protected      foo
-.globl foo
-       .data
-       .align 4
-       .type   foo, @object
-       .size   foo, 4
-foo:
-       .long   1
diff --git a/ld/testsuite/ld-x86-64/pr17709b.s b/ld/testsuite/ld-x86-64/pr17709b.s
deleted file mode 100644 (file)
index c57f404..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-       .text
-       .globl  _start
-       .type   _start, @function
-_start:
-       movl    foo, %eax
index d8f09daa749527dcde1f1f3619a131be623b64f2..22a36ac4c8f404b8db69331d7411c769226949b8 100644 (file)
@@ -8,7 +8,6 @@
 Disassembly of section .text:
 
 0+[a-f0-9]+ <bar>:
-[      ]*[a-f0-9]+:    48 8b 05 ([0-9a-f]{2} ){4} *    mov    0x[a-f0-9]+\(%rip\),%rax        # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
-[      ]*[a-f0-9]+:    8b 00                   mov    \(%rax\),%eax
+[      ]*[a-f0-9]+:    8b 05 ([0-9a-f]{2} ){4} *       mov    0x[a-f0-9]+\(%rip\),%eax        # [a-f0-9]+ <foo>
 [      ]*[a-f0-9]+:    c3                      retq *
 #pass
index 75380501746a9ab96f99971eddbdf21b3c70d8e2..e4af6e7fb342e77aec9266aa5e10ae8de9663001 100644 (file)
@@ -10,7 +10,6 @@ foo:
 .globl bar
        .type   bar, @function
 bar:
-       movq    foo@GOTPCREL(%rip), %rax
-       movl    (%rax), %eax
+       movl    foo(%rip), %eax
        ret
        .size   bar, .-bar
index 98514ed0ad29d566cdc5577b82b6589b499b80e1..0b75ecd2db5e1c64c2f06f5d5a3cbbe61e7ad1ca 100644 (file)
@@ -144,10 +144,6 @@ set x86_64tests {
      "--64" {pr17306b.s} {} ""}
     {"PR ld/17306 (2)" "-melf_x86_64 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
      "--64" {pr17306a.s} {} "libpr17306.so"}
-    {"PR ld/17709 (1)" "-melf_x86_64 -shared" ""
-     "--64" {pr17709a.s} {} "libpr17709.so"}
-    {"PR ld/17709 (2)" "-melf_x86_64 tmpdir/libpr17709.so" ""
-     "--64" {pr17709b.s} {{readelf -rW pr17709.rd}} "pr17709"}
 }
 
 # So as to avoid rewriting every last test case here in a nacl variant,
This page took 0.048538 seconds and 4 git commands to generate.