2004-11-30 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Tue, 30 Nov 2004 17:45:54 +0000 (17:45 +0000)
committerPaul Brook <paul@codesourcery.com>
Tue, 30 Nov 2004 17:45:54 +0000 (17:45 +0000)
bfd/
* elf32-arm.c (struct elf32_arm_link_hash_table): Remove
no_pipeline_knowledge
(elf32_arm_link_hash_table_create): Ditto.
(bfd_elf32_arm_process_before_allocation): Ditto.
(elf32_arm_final_link_relocate): Ditto.  Remove oabi relocation
handling.
* bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
prototype.
* bfd-in2.h: Regenerate.
ld/
* emultempl/armelf.em: Ignore -p and -no-pipeline-knowledge.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/elf32-arm.c
ld/ChangeLog
ld/emultempl/armelf.em

index 5fe9ae6776cce4e012f0ff272ffe4cbae0920acb..6a1d301b58453c08e6885ce2f34ec4d2c76a26d8 100644 (file)
@@ -1,3 +1,15 @@
+2004-11-30  Paul Brook  <paul@codesourcery.com>
+
+       * elf32-arm.c (struct elf32_arm_link_hash_table): Remove
+       no_pipeline_knowledge
+       (elf32_arm_link_hash_table_create): Ditto.
+       (bfd_elf32_arm_process_before_allocation): Ditto.
+       (elf32_arm_final_link_relocate): Ditto.  Remove oabi relocation
+       handling.
+       * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
+       prototype.
+       * bfd-in2.h: Regenerate.
+
 2004-11-30  Randolph Chung  <tausq@debian.org>
 
        * elf32-hppa.c (elf32_hppa_grok_prstatus): New function.
index 04dfe69d490951ae62d495adfe8a4373c6619d72..ff84516eebc3d5e2cd4014830d991f3a8e71e25d 100644 (file)
@@ -814,7 +814,7 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int, int);
+  (bfd *, struct bfd_link_info *, int);
 
 void bfd_elf32_arm_set_target_relocs
   (struct bfd_link_info *, int, char *);
index c39e4f8779d96da9fe1d6d65dfd25d2a515f3ba2..b10883c310835216a324179e7ed67c247e001cb7 100644 (file)
@@ -821,7 +821,7 @@ extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int, int);
+  (bfd *, struct bfd_link_info *, int);
 
 void bfd_elf32_arm_set_target_relocs
   (struct bfd_link_info *, int, char *);
index 0154195d4202d3f953662b1e88efa079390a8d37..0b031e0a08bdcec4066796a19299d24c2904436d 100644 (file)
@@ -1161,10 +1161,6 @@ struct elf32_arm_link_hash_table
     /* An arbitrary input BFD chosen to hold the glue sections.  */
     bfd * bfd_of_glue_owner;
 
-    /* A boolean indicating whether knowledge of the ARM's pipeline
-       length should be applied by the linker.  */
-    int no_pipeline_knowledge;
-
     /* Nonzero to output a BE8 image.  */
     int byteswap_code;
 
@@ -1382,7 +1378,6 @@ elf32_arm_link_hash_table_create (bfd *abfd)
   ret->thumb_glue_size = 0;
   ret->arm_glue_size = 0;
   ret->bfd_of_glue_owner = NULL;
-  ret->no_pipeline_knowledge = 0;
   ret->byteswap_code = 0;
   ret->target1_is_rel = 0;
   ret->target2_reloc = R_ARM_NONE;
@@ -1771,7 +1766,6 @@ bfd_elf32_arm_get_bfd_for_interworking (bfd *abfd, struct bfd_link_info *info)
 bfd_boolean
 bfd_elf32_arm_process_before_allocation (bfd *abfd,
                                         struct bfd_link_info *link_info,
-                                        int no_pipeline_knowledge,
                                         int byteswap_code)
 {
   Elf_Internal_Shdr *symtab_hdr;
@@ -1794,8 +1788,6 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd,
   BFD_ASSERT (globals != NULL);
   BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
 
-  globals->no_pipeline_knowledge = no_pipeline_knowledge;
-
   if (byteswap_code && !bfd_big_endian (abfd))
     {
       _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."),
@@ -2494,61 +2486,29 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                }
            }
 
-         if (   strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
-             || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0)
-           {
-             /* The old way of doing things.  Trearing the addend as a
-                byte sized field and adding in the pipeline offset.  */
-             value -= (input_section->output_section->vma
-                       + input_section->output_offset);
-             value -= rel->r_offset;
-             value += addend;
-
-             if (! globals->no_pipeline_knowledge)
-               value -= 8;
-           }
-         else
-           {
-             /* The ARM ELF ABI says that this reloc is computed as: S - P + A
-                where:
-                 S is the address of the symbol in the relocation.
-                 P is address of the instruction being relocated.
-                 A is the addend (extracted from the instruction) in bytes.
-
-                S is held in 'value'.
-                P is the base address of the section containing the
-                  instruction plus the offset of the reloc into that
-                  section, ie:
-                    (input_section->output_section->vma +
-                     input_section->output_offset +
-                     rel->r_offset).
-                A is the addend, converted into bytes, ie:
-                    (signed_addend * 4)
-
-                Note: None of these operations have knowledge of the pipeline
-                size of the processor, thus it is up to the assembler to
-                encode this information into the addend.  */
-             value -= (input_section->output_section->vma
-                       + input_section->output_offset);
-             value -= rel->r_offset;
-             value += (signed_addend << howto->size);
-
-             /* Previous versions of this code also used to add in the
-                pipeline offset here.  This is wrong because the linker is
-                not supposed to know about such things, and one day it might
-                change.  In order to support old binaries that need the old
-                behaviour however, so we attempt to detect which ABI was
-                used to create the reloc.  */
-             if (! globals->no_pipeline_knowledge)
-               {
-                 Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
-
-                 i_ehdrp = elf_elfheader (input_bfd);
-
-                 if (i_ehdrp->e_ident[EI_OSABI] == 0)
-                   value -= 8;
-               }
-           }
+         /* The ARM ELF ABI says that this reloc is computed as: S - P + A
+            where:
+             S is the address of the symbol in the relocation.
+             P is address of the instruction being relocated.
+             A is the addend (extracted from the instruction) in bytes.
+
+            S is held in 'value'.
+            P is the base address of the section containing the
+              instruction plus the offset of the reloc into that
+              section, ie:
+                (input_section->output_section->vma +
+                 input_section->output_offset +
+                 rel->r_offset).
+            A is the addend, converted into bytes, ie:
+                (signed_addend * 4)
+
+            Note: None of these operations have knowledge of the pipeline
+            size of the processor, thus it is up to the assembler to
+            encode this information into the addend.  */
+         value -= (input_section->output_section->vma
+                   + input_section->output_offset);
+         value -= rel->r_offset;
+         value += (signed_addend << howto->size);
 
          signed_addend = value;
          signed_addend >>= howto->rightshift;
@@ -2733,23 +2693,6 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                       + input_section->output_offset
                       + rel->r_offset);
 
-       if (! globals->no_pipeline_knowledge)
-         {
-           Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form.  */
-
-           i_ehdrp = elf_elfheader (input_bfd);
-
-           /* Previous versions of this code also used to add in the pipline
-              offset here.  This is wrong because the linker is not supposed
-              to know about such things, and one day it might change.  In order
-              to support old binaries that need the old behaviour however, so
-              we attempt to detect which ABI was used to create the reloc.  */
-           if (   strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
-               || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0
-               || i_ehdrp->e_ident[EI_OSABI] == 0)
-             relocation += 4;
-         }
-
        check = relocation >> howto->rightshift;
 
        /* If this is a signed value, the rightshift just dropped
index c6447207f3ee6ac1d2774215a0ea4b441b076c47..97cc36cd7e0be30c744f9d3a20a5288fca1c8e8c 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-30  Paul Brook  <paul@codesourcery.com>
+
+       * emultempl/armelf.em: Ignore -p and -no-pipeline-knowledge.
+
 2004-11-30  Tero Niemela  <tero_niemela@yahoo.com>
 
        * Makefile.am: Change LOCALEDIR to $(datadir)/share.
index 3e594cbdc74d97a9b76acfa774a437604b99ebee..b292cd13fb5ad230801b5ae684469c283c6470fc 100644 (file)
@@ -25,7 +25,6 @@
 test -z $TARGET2_TYPE && TARGET2_TYPE="rel"
 cat >>e${EMULATION_NAME}.c <<EOF
 
-static int no_pipeline_knowledge = 0;
 static char *thumb_entry_symbol = NULL;
 static bfd *bfd_for_interwork;
 static int byteswap_code = 0;
@@ -125,7 +124,6 @@ arm_elf_before_allocation (void)
     LANG_FOR_EACH_INPUT_STATEMENT (is)
       {
        if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
-                                                     no_pipeline_knowledge,
                                                      byteswap_code))
          {
            /* xgettext:c-format */
@@ -219,7 +217,6 @@ PARSE_AND_LIST_LONGOPTS='
 '
 
 PARSE_AND_LIST_OPTIONS='
-  fprintf (file, _("  -p --no-pipeline-knowledge  Stop the linker knowing about the pipeline length\n"));
   fprintf (file, _("     --thumb-entry=<sym>      Set the entry point to be Thumb symbol <sym>\n"));
   fprintf (file, _("     --be8                    Oputput BE8 format image\n"));
   fprintf (file, _("     --target1=rel            Interpret R_ARM_TARGET1 as R_ARM_REL32\n"));
@@ -229,7 +226,7 @@ PARSE_AND_LIST_OPTIONS='
 
 PARSE_AND_LIST_ARGS_CASES='
     case '\'p\'':
-      no_pipeline_knowledge = 1;
+      /* Only here for backwards compatibility.  */
       break;
 
     case OPTION_THUMB_ENTRY: