This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch mach-o/bfd/gas] handle ABS indirect_symbols.


a minor update to handle ABS symbols in the indirect symbol table.
tests attached

OK?
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 ... */



Attachment: 12011218-dysym-abs-test.txt
Description: Text document





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]