------- Additional Comments From wilson at specifix dot com 2006-09-13 21:01 ------- Subject: Re: elfxx-ia64.c doesn't support @ltoff(@fptr(_DYNAMIC#))
On Mon, 2006-09-11 at 22:17 +0000, hjl at lucon dot org wrote: > + (*_bfd_error_handler) > + (_("%B: failed to record local dynamic symbol `%s'"), > + h->root.u.def.section->owner, h->root.root.string); That looks like a good solution for this problem. > However, it doesn't work for this: Yes, this is another complication. The problem here is that _DYNAMIC is a magic linker variable. It isn't a variable that came from one of the object files. The variable gets created by a call to _bfd_elf_define_linkage_sym, which puts it in the global symbol hash table, but not the symbol list for the bar.o file as it didn't come from bar.o. However, it is in the bar.o .dynamic section which has a section->owner which points to bar.o. So in allocate_fptr, we call global_sym_index, which then assumes that it must be in bar.o, and segfaults because it doesn't handle the failure case. There are a few interesting things about your testcase. I get the same error if I use _GLOBAL_OFFSET_TABLE_ instead of _DYNAMIC. I get no error if I switch the order of the .o files on the link line. This is because section->owner now points to foo.o, and the variable is in foo.o's symbol table because it was explicitly referenced there. I think we can handle this with a simple extension of your current patch. First we fix global_sym_index to handle the failure case where p == 0. We can just return 0 in that case. Second, we fix allocate_fptr to check for a 0 return value from global_sym_index, and emit the same error message as above. I don't think there is any field in a symbol that says this is a magic linker created variable. That would be convenient if it existed. -- http://sourceware.org/bugzilla/show_bug.cgi?id=3169 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils