2011-12-05 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Mon, 5 Dec 2011 14:42:31 +0000 (14:42 +0000)
committerTristan Gingold <gingold@adacore.com>
Mon, 5 Dec 2011 14:42:31 +0000 (14:42 +0000)
* mach-o.c (bfd_mach_o_read_symtab_symbol): Accept indirect symbols.

bfd/ChangeLog
bfd/mach-o.c

index 7d96b5f8f5284c03d6b0752428e9e09b35029f2f..2f7f59a4f98f3325ca249b8f26df14258c77e91b 100644 (file)
@@ -1,3 +1,7 @@
+2011-12-05  Tristan Gingold  <gingold@adacore.com>
+
+       * mach-o.c (bfd_mach_o_read_symtab_symbol): Accept indirect symbols.
+
 2011-12-05  Tristan Gingold  <gingold@adacore.com>
 
        * mach-o.c (bfd_mach_o_write_contents): Handle LC_LOAD_UPWARD_DYLIB.
index 4412b0b98bcb7645ea2935896c00aa5c7b39406e..04c971e47f43c4c95c43bc0f3abb2602ef58a698 100644 (file)
@@ -1901,10 +1901,12 @@ bfd_mach_o_read_symtab_symbol (bfd *abfd,
            }
          break;
        case BFD_MACH_O_N_INDR:
-         (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: "
-                                  "symbol \"%s\" is unsupported 'indirect' reference: setting to undefined"),
-                                s->symbol.name);
-         s->symbol.section = bfd_und_section_ptr;
+         /* FIXME: we don't follow the BFD convention as this indirect symbol
+            won't be followed by the referenced one.  This looks harmless
+            unless we start using the linker.  */
+         s->symbol.flags |= BSF_INDIRECT;
+         s->symbol.section = bfd_ind_section_ptr;
+         s->symbol.value = 0;
          break;
        default:
          (*_bfd_error_handler) (_("bfd_mach_o_read_symtab_symbol: "