symbolS *sym = NULL;
unsigned int align = 0;
unsigned int specified_mask = 0;
- offsetT size;
+ offsetT size = 0;
#ifdef md_flush_pending_output
md_flush_pending_output ();
for (isym = list, n = 0; isym != NULL; isym = isym->next, n++)
{
+ sym = (bfd_mach_o_asymbol *)symbol_get_bfdsym (isym->sym);
/* Array is init to NULL & NULL signals a local symbol
If the section is lazy-bound, we need to keep the
- reference to the symbol, since dyld can override. */
- if (S_IS_LOCAL (isym->sym) && ! lazy)
+ reference to the symbol, since dyld can override.
+
+ Absolute symbols are handled specially. */
+ if (sym->symbol.section == bfd_abs_section_ptr)
+ ms->indirect_syms[n] = sym;
+ else if (S_IS_LOCAL (isym->sym) && ! lazy)
;
else
{
- sym = (bfd_mach_o_asymbol *)symbol_get_bfdsym (isym->sym);
if (sym == NULL)
;
/* If the symbols is external ... */
bfd_map_over_sections (stdoutput, obj_mach_o_set_indirect_symbols, (char *) 0);
}
+/* Reverse relocations order to make ld happy. */
+
+void
+obj_mach_o_reorder_section_relocs (asection *sec, arelent **rels, unsigned int n)
+{
+ unsigned int i;
+ unsigned int max = n / 2;
+
+ for (i = 0; i < max; i++)
+ {
+ arelent *r = rels[i];
+ rels[i] = rels[n - i - 1];
+ rels[n - i - 1] = r;
+ }
+ bfd_set_reloc (stdoutput, sec, rels, n);
+}
+
/* Support stabs for mach-o. */
void