ldlang.c (print_assignment): Do not rely upon a valid result having a section
authorNick Clifton <nickc@redhat.com>
Tue, 17 May 2005 14:39:18 +0000 (14:39 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 17 May 2005 14:39:18 +0000 (14:39 +0000)
  associated with it.
elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle the situation
  where a symbols's section is not known but a section relative R_ARM_RELATIVE
  reloc has to be generated for the Symbian OS.

bfd/ChangeLog
bfd/elf32-arm.c
ld/ChangeLog
ld/ldlang.c

index 3dd9ed05bd9eec2c26671d4156a5a05d8a38fc9f..3d2b2d9b230b3a43e99f4df3da5a5df7ff4ddfd6 100644 (file)
@@ -7,6 +7,11 @@
 
 2005-05-17  Nick Clifton  <nickc@redhat.com>
 
+       * elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle
+       the situation where a symbols's section is not known but a section
+       relative R_ARM_RELATIVE reloc has to be generated for the Symbian
+       OS.
+
        * elf32-v850.c (v850_elf_relocate_section): Move code to test for
        the presence of a symbol table to just before the symbol table is
        actually used.
index 2e5ca4c612a14ca7ac60e2aeac51c676af5005cb..73554cfcc7d020fade633d94bc04ae45979b7fed 100644 (file)
@@ -2692,7 +2692,10 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
                     the section symbol as it is convenient.  (We
                     cannot use the symbol given by "h" directly as it
                     will not appear in the dynamic symbol table.)  */
-                 symbol = elf_section_data (sym_sec->output_section)->dynindx;
+                 if (sym_sec)
+                   symbol = elf_section_data (sym_sec->output_section)->dynindx;
+                 else
+                   symbol = elf_section_data (input_section->output_section)->dynindx;
                  BFD_ASSERT (symbol != 0);
                }
              else
index 342b9392588acec6ba0e28beee04b3053b4a8ab7..27654cb84d8aa0958c357acdff42af8ec270dbbd 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-17  Julian Brown <julian@codesourcery.com>
+
+       * ldlang.c (print_assignment): Do not rely upon a valid result
+       having a section associated with it.
+
 2005-05-17  Nick Clifton  <nickc@redhat.com>
 
        * ldlang.c (Scan_for_self_assignment): Check an assignment tree to
index 19b986abc792fb74033a1130f71b758710810a12..ee85422b307b43f05ca75abc6d49c012d9c433ba 100644 (file)
@@ -3219,7 +3219,10 @@ print_assignment (lang_assignment_statement_type *assignment,
 
       if (computation_is_valid)
        {
-         value = result.value + result.section->bfd_section->vma;
+         value = result.value;
+
+         if (result.section)
+           value += result.section->bfd_section->vma;
 
          minfo ("0x%V", value);
          if (is_dot)
@@ -3233,7 +3236,10 @@ print_assignment (lang_assignment_statement_type *assignment,
                                    FALSE, FALSE, TRUE);
          if (h)
            {
-             value = h->u.def.value + result.section->bfd_section->vma;
+             value = h->u.def.value;
+
+             if (result.section)
+             value += result.section->bfd_section->vma;
 
              minfo ("[0x%V]", value);
            }