This is the mail archive of the binutils@sources.redhat.com 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]

Re: gdb.mi/mi-cli.exp failures


Daniel Jacobowitz <drow at mvista dot com> writes:

> Well, do you have another suggestion for how to approach this?  We're
> not actually linking; but I need to get the symbols from the input file
> into a symbol table with forged offsets in order to apply relocations
> against them.

Well, I don't really know the context.  If you're not linking, then it
seems to me that you'll be better off avoiding the linking calls.  The
add_symbols() call is the first phase of a link, and is expected to be
followed by the second phase of a link; despite the name
add_symbols(), it doesn't just add symbols to a hash table.

If you really just want to put the symbols into a hash table, can you
just get the symbol table generically and add them to a hash table
yourself?

> > Well, I'm afraid that you will have to deal with a number of other
> > cases if you want to avoid adding sections to input files.  Take a
> > look at elf_link_create_dynamic_sections().
> 
> In any case I can remove the assumption; it's not hard.  I assume that
> if I save pointers to the sections present before calling
> elf_link_add_object_symbols, that they'll still be valid when it
> returns?

Probably.  But I personally don't think the add_symbols() routine
needs to make any guarantees at all, except that if you hook up and
the sections and call final_link() you will get a linked output file.
Maybe we should change the name add_symbols() to initial_link().

Ian


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