This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch mach-o/gas] fix thinko in indirect symbol handling.
- From: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
- To: binutils Development <binutils at sourceware dot org>
- Cc: Tristan Gingold <gingold at adacore dot com>
- Date: Fri, 10 Feb 2012 12:37:50 +0000
- Subject: [Patch mach-o/gas] fix thinko in indirect symbol handling.
indirect symbols are stored away as we encounter them, and then
processed/validated fairly late in the output.
this causes a problem if one uses a "L" local symbol as an indirect
(something which compiler-output doesn't seem to, I only found this
with one of my artificial test-cases).
the problem is that (the output-time) processing of the symbol as an
indirect causes it to be 'promoted' to a real one (with a bfd
counterpart). This ICEs GAS because the symtab is frozen by then.
Anyway, the simplest solution is to force 'promotion' of "L"ocal
symbols at the point they are known to be indirect refs.
OK?
Iain
gas:
* config/obj-macho.c (obj_mach_o_indirect_symbol): Force promotion of
any local
symbol used as an indirect.
iff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
index f4706ab..925fe06 100644
--- a/gas/config/obj-macho.c
+++ b/gas/config/obj-macho.c
@@ -1182,6 +1182,11 @@ obj_mach_o_indirect_symbol (int arg
ATTRIBUTE_UNUSED)
}
*input_line_pointer = c;
+ /* The indirect symbols are validated after the symbol table is
+ frozen, we must make sure that if a local symbol is used as an
+ indirect, it is promoted to a 'real' one. Fetching the bfd sym
+ achieves this. */
+ symbol_get_bfdsym (sym);
isym = (obj_mach_o_indirect_sym *)
xmalloc (sizeof (obj_mach_o_indirect_sym));