]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorAlan Modra <amodra@gmail.com>
Tue, 30 Sep 2008 01:16:22 +0000 (01:16 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 30 Sep 2008 01:16:22 +0000 (01:16 +0000)
PR 6789
* elf.c (assign_file_positions_for_load_sections): Call
_bfd_elf_map_sections_to_segments, not elf_modify_segment_map.
(get_program_header_size): Protect against NULL info.
(_bfd_elf_map_sections_to_segments): Likewise.
* elf32-spu.c (spu_elf_additional_program_headers): Likewise.
ld/testsuite/
* ld-elf/extract-symbol-1sec.d: Correct section lma.

bfd/ChangeLog
bfd/elf.c
bfd/elf32-spu.c
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/extract-symbol-1sec.d

index e9a2c3eeda23c1f59d6306ed4e8a3c042fef6725..5782642103690de5f5a3628aaf2c0cc26b836d8b 100644 (file)
@@ -1,3 +1,12 @@
+2008-09-30  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 6789
+       * elf.c (assign_file_positions_for_load_sections): Call
+       _bfd_elf_map_sections_to_segments, not elf_modify_segment_map.
+       (get_program_header_size): Protect against NULL info.
+       (_bfd_elf_map_sections_to_segments): Likewise.
+       * elf32-spu.c (spu_elf_additional_program_headers): Likewise.
+
 2008-09-29  Nick Clifton  <nickc@redhat.com>
 
        * po/vi.po: Updated Vietnamese translation.
index 7f9853e6540d7033eb3b5388f68152c509af80c8..7822c6e99d17aa9966fb6607b2ff183525cb958d 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3386,7 +3386,7 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
       ++segs;
     }
 
-  if (info->relro)
+  if (info != NULL && info->relro)
     {
       /* We need a PT_GNU_RELRO segment.  */
       ++segs;
@@ -3768,8 +3768,13 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
            }
 
          /* Allow interested parties a chance to override our decision.  */
-         if (last_hdr && info->callbacks->override_segment_assignment)
-           new_segment = info->callbacks->override_segment_assignment (info, abfd, hdr, last_hdr, new_segment);
+         if (last_hdr != NULL
+             && info != NULL
+             && info->callbacks->override_segment_assignment != NULL)
+           new_segment
+             = info->callbacks->override_segment_assignment (info, abfd, hdr,
+                                                             last_hdr,
+                                                             new_segment);
 
          if (! new_segment)
            {
@@ -3944,7 +3949,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
          pm = &m->next;
        }
 
-      if (info->relro)
+      if (info != NULL && info->relro)
        {
          for (m = mfirst; m != NULL; m = m->next)
            {
@@ -4128,7 +4133,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
   unsigned int i, j;
 
   if (link_info == NULL
-      && !elf_modify_segment_map (abfd, link_info, FALSE))
+      && !_bfd_elf_map_sections_to_segments (abfd, link_info))
     return FALSE;
 
   alloc = 0;
index 17ff079c0cccdfcf3da6aae52b062d9d636453c9..00681b2b5b9be0900bbc7a17edfce7d73a724aef 100644 (file)
@@ -4245,10 +4245,15 @@ spu_elf_post_process_headers (bfd *abfd,
 static int
 spu_elf_additional_program_headers (bfd *abfd, struct bfd_link_info *info)
 {
-  struct spu_link_hash_table *htab = spu_hash_table (info);
-  int extra = htab->num_overlays;
+  int extra = 0;
   asection *sec;
 
+  if (info != NULL)
+    {
+      struct spu_link_hash_table *htab = spu_hash_table (info);
+      extra = htab->num_overlays;
+    }
+
   if (extra)
     ++extra;
 
index da458c0ab8fedbf4682d3de0c7dd5810b74e7038..eec96841641817cfab446859d01408e36739dbd7 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-30  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld-elf/extract-symbol-1sec.d: Correct section lma.
+
 2008-09-22  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * ld-mips-elf/reloc-estimate-1.d: Make endian-neutral.
index 87d42af9250f9862d4381225f56379bcc34b6628..cbe0144dee880696dcf459e9c6e2da9831f4b1d8 100644 (file)
@@ -7,7 +7,7 @@
 #...
 Sections:
  *Idx +Name +Size +VMA +LMA .*
- *0 +\.foo +0+ +0+10000 +0+10000 .*
+ *0 +\.foo +0+ +0+10000 +0+ .*
  *CONTENTS, ALLOC, LOAD, CODE
- *1 +\.bar +0+ +0+20000 +0+20000 .*
+ *1 +\.bar +0+ +0+20000 +0+10000 .*
  *ALLOC, READONLY, CODE