]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ldlang.h (lang_output_section_statement_type): Rearrange. Remove
authorAlan Modra <amodra@gmail.com>
Thu, 3 Nov 2005 02:54:10 +0000 (02:54 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 3 Nov 2005 02:54:10 +0000 (02:54 +0000)
memspec.  Make "processed" a bitfield.
(lang_data_statement_type, lang_reloc_statement_type): Rename
output_vma to output_offset.
* ldlang.c (lang_output_section_statement_lookup_1): Init
all_input_readonly.  Don't init memspec.
(init_os): Remove incorrect comment.
(print_data_statement, print_reloc_statement): Adjust for
lang_data_statement_type and lang_reloc_statement_type change.
(lang_size_sections_1, lang_add_reloc): Likewise.
* ldwrite.c (build_link_order): Likewise.

ld/ChangeLog
ld/ldlang.c
ld/ldlang.h
ld/ldwrite.c

index e8861458159198abdf011c2ce2398f072cd841e2..25f0ccb63b3f19a52a0e3d3c4afedfe11767a1e1 100644 (file)
@@ -1,3 +1,17 @@
+2005-11-03  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.h (lang_output_section_statement_type): Rearrange.  Remove
+       memspec.  Make "processed" a bitfield.
+       (lang_data_statement_type, lang_reloc_statement_type): Rename
+       output_vma to output_offset.
+       * ldlang.c (lang_output_section_statement_lookup_1): Init
+       all_input_readonly.  Don't init memspec.
+       (init_os): Remove incorrect comment.
+       (print_data_statement, print_reloc_statement): Adjust for
+       lang_data_statement_type and lang_reloc_statement_type change.
+       (lang_size_sections_1, lang_add_reloc): Likewise.
+       * ldwrite.c (build_link_order): Likewise.
+
 2005-10-30  Mark Mitchell  <mark@codesourcery.com>
 
        * lexsup.c (help): Document "@FILE".
index 7824d2430c99113dd64ce907df4f5952444c6a7c..c4b1b9cc73971f02de5cd2f709d7705510244187 100644 (file)
@@ -1087,12 +1087,12 @@ lang_output_section_statement_lookup_1 (const char *const name, int constraint)
       lookup->bfd_section = NULL;
       lookup->processed = FALSE;
       lookup->constraint = constraint;
+      lookup->all_input_readonly = FALSE;
       lookup->ignored = FALSE;
       lookup->sectype = normal_section;
       lookup->addr_tree = NULL;
       lang_list_init (&lookup->children);
 
-      lookup->memspec = NULL;
       lookup->flags = 0;
       lookup->subsection_alignment = -1;
       lookup->section_alignment = -1;
@@ -1691,9 +1691,6 @@ init_os (lang_output_section_statement_type *s, asection *isec)
             output_bfd->xvec->name, s->name);
     }
   s->bfd_section->output_section = s->bfd_section;
-
-  /* We initialize an output sections output offset to minus its own
-     vma to allow us to output a section through itself.  */
   s->bfd_section->output_offset = 0;
   if (!command_line.reduce_memory_overheads)
     {
@@ -3545,7 +3542,7 @@ print_data_statement (lang_data_statement_type *data)
   for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
     print_space ();
 
-  addr = data->output_vma;
+  addr = data->output_offset;
   if (data->output_section != NULL)
     addr += data->output_section->vma;
 
@@ -3612,7 +3609,7 @@ print_reloc_statement (lang_reloc_statement_type *reloc)
   for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
     print_space ();
 
-  addr = reloc->output_vma;
+  addr = reloc->output_offset;
   if (reloc->output_section != NULL)
     addr += reloc->output_section->vma;
 
@@ -4292,7 +4289,7 @@ lang_size_sections_1
          {
            unsigned int size = 0;
 
-           s->data_statement.output_vma =
+           s->data_statement.output_offset =
              dot - output_section_statement->bfd_section->vma;
            s->data_statement.output_section =
              output_section_statement->bfd_section;
@@ -4330,7 +4327,7 @@ lang_size_sections_1
          {
            int size;
 
-           s->reloc_statement.output_vma =
+           s->reloc_statement.output_offset =
              dot - output_section_statement->bfd_section->vma;
            s->reloc_statement.output_section =
              output_section_statement->bfd_section;
@@ -5680,7 +5677,7 @@ lang_add_reloc (bfd_reloc_code_real_type reloc,
 
   p->addend_value = 0;
   p->output_section = NULL;
-  p->output_vma = 0;
+  p->output_offset = 0;
 }
 
 lang_assignment_statement_type *
index 168caecf4767812fe1ba1249d76e2002423b6cae..12523a4fac4ce1f294abb168fc9bb010033a0f1c 100644 (file)
@@ -128,28 +128,14 @@ typedef struct lang_output_section_phdr_list
 typedef struct lang_output_section_statement_struct
 {
   lang_statement_header_type header;
-  union etree_union *addr_tree;
   lang_statement_list_type children;
-  const char *memspec;
   struct lang_output_section_statement_struct *next;
   const char *name;
-
-  bfd_boolean processed;
-
   asection *bfd_section;
-  flagword flags;              /* Or together of all input sections.  */
-  enum section_type sectype;
   lang_memory_region_type *region;
   lang_memory_region_type *lma_region;
-  size_t block_value;
   fill_type *fill;
-
-  int subsection_alignment;    /* Alignment of components.  */
-  int section_alignment;       /* Alignment of start of section.  */
-  int constraint;
-  unsigned int all_input_readonly : 1;
-  unsigned int ignored : 1; 
-
+  union etree_union *addr_tree;
   union etree_union *load_base;
 
   /* If non-null, an expression to evaluate after setting the section's
@@ -159,6 +145,16 @@ typedef struct lang_output_section_statement_struct
   union etree_union *update_dot_tree;
 
   lang_output_section_phdr_list *phdrs;
+
+  unsigned int block_value;
+  int subsection_alignment;    /* Alignment of components.  */
+  int section_alignment;       /* Alignment of start of section.  */
+  int constraint;
+  flagword flags;
+  enum section_type sectype;
+  unsigned int processed : 1;
+  unsigned int all_input_readonly : 1;
+  unsigned int ignored : 1; 
 } lang_output_section_statement_type;
 
 typedef struct
@@ -186,7 +182,7 @@ typedef struct
   union etree_union *exp;
   bfd_vma value;
   asection *output_section;
-  bfd_vma output_vma;
+  bfd_vma output_offset;
 } lang_data_statement_type;
 
 /* Generate a reloc in the output file.  */
@@ -218,8 +214,8 @@ typedef struct
   /* Output section where reloc should be performed.  */
   asection *output_section;
 
-  /* VMA within output section.  */
-  bfd_vma output_vma;
+  /* Offset within output section.  */
+  bfd_vma output_offset;
 } lang_reloc_statement_type;
 
 typedef struct lang_input_statement_struct
index e311743f0cb712a43ddb4b3878c6eb81a0dad81c..d7bfab835c16e49d10c2b07e490537b425097517 100644 (file)
@@ -55,7 +55,7 @@ build_link_order (lang_statement_union_type *statement)
          einfo (_("%P%F: bfd_new_link_order failed\n"));
 
        link_order->type = bfd_data_link_order;
-       link_order->offset = statement->data_statement.output_vma;
+       link_order->offset = statement->data_statement.output_offset;
        link_order->u.data.contents = xmalloc (QUAD_SIZE);
 
        value = statement->data_statement.value;
@@ -190,7 +190,7 @@ build_link_order (lang_statement_union_type *statement)
        if (link_order == NULL)
          einfo (_("%P%F: bfd_new_link_order failed\n"));
 
-       link_order->offset = rs->output_vma;
+       link_order->offset = rs->output_offset;
        link_order->size = bfd_get_reloc_size (rs->howto);
 
        link_order->u.reloc.p = xmalloc (sizeof (struct bfd_link_order_reloc));