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]

Re: [gold] "patch" for the incremental link design document


I talked with Ian a bit more and he noticed that the second proposal
was incomplete. If, in the example of the previous email, a new
undefined reference shows up in a.o we wouldn't be able to find the
linked list of files for that symbol since the symbol was unused
before and therefore not in the global symbol table.

An updated proposal that I think addresses this issues is

--------------------------------
Change the "For an object file or shared library" section into:

For an object file, shared library or archive

1. 4 byte count of input sections

   * Always zero for a shared library or archive.

2. 4 byte count of global symbols. In the case of an archive, this
will be the count of symbols in the *unused* members.

3. For each input section:

  1. 4 byte offset to section name in .gnu_incremental_strtab section
  2. 4 byte output section index
         * If input section is omitted, this is zero.
  3. 8 byte offset of input section in output section
  4. 8 byte input section size

4. For each global symbol:

  1. 4 byte index into output global symbol table if the symbol if an
object file or library. 4 byte offset into .gnu_incremental_strtab if
an archive.
  2. 4 byte offset to next linked list entry
         * Linked list starts from global symbol list.
         * Offset is to entry in input file list.
  3. 4 byte count of relocations for this file.
  4. 4 byte offset to relocations in .gnu_incremental_relocs section.
---------------------------------

The change is that now t the symbols in unused archive members point
to the incremental string table. This should give us enough
information to build the necessary lists for each symbol.

For example, lets say b.o defines foo and is used. c.o defines bar and
is unused. Executing

ar q a,a b,o c,o
ld -incremental d.o a.a -o exec

Will produce (among others) the lists

foo -> b.o
bar -> a.a

now if we change d.o and add an undefined reference to bar we can just
look up the list for bar, find that a.a is on it and force a relink.

Cheers,
-- 
Rafael Ãvila de EspÃndola


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