This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch mach-o/bfd/gas] handle ABS indirect_symbols.
- From: Tristan Gingold <gingold at adacore dot com>
- To: Iain Sandoe <developer at sandoe-acoustics dot co dot uk>
- Cc: binutils Development <binutils at sourceware dot org>
- Date: Fri, 13 Jan 2012 09:17:10 +0100
- Subject: Re: [Patch mach-o/bfd/gas] handle ABS indirect_symbols.
- References: <79D2A42E-1056-4ED2-B0C2-7E097C3844AE@sandoe-acoustics.co.uk>
On Jan 12, 2012, at 7:28 PM, Iain Sandoe wrote:
> a minor update to handle ABS symbols in the indirect symbol table.
> tests attached
>
> OK?
Ok.
Thanks,
Tristan.
> Iain
>
> bfd:
>
> * mach-o.c (bfd_mach_o_build_dysymtab_command): Handle ABS symbols.
>
> gas:
>
> * config/obj-macho.c (obj_mach_o_set_indirect_symbols): Handle ABS symbols.
>
> bfd/mach-o.c | 3 +++
> gas/config/obj-macho.c | 10 +++++++---
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/bfd/mach-o.c b/bfd/mach-o.c
> index c519663..0846fe6 100644
> --- a/bfd/mach-o.c
> +++ b/bfd/mach-o.c
> @@ -2199,6 +2199,9 @@ bfd_mach_o_build_dysymtab_command (bfd *abfd,
> {
> if (isyms[j] == NULL)
> dsym->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL;
> + else if (isyms[j]->symbol.section == bfd_abs_section_ptr)
> + dsym->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL
> + | BFD_MACH_O_INDIRECT_SYM_ABS;
> else
> dsym->indirect_syms[n] = isyms[j]->symbol.udata.i;
> }
> diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
> index 61e6771..c381dbe 100644
> --- a/gas/config/obj-macho.c
> +++ b/gas/config/obj-macho.c
> @@ -1545,14 +1545,18 @@ obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec,
>
> 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 ... */
>
>
> <12011218-dysym-abs-test.txt>
>
>