[LLVMdev] Need to create symbols only once

Shankar Easwaran
Fri, 07 Dec 2012 19:51:30 -0000

Hi Nick,

We have few symbols like __bss_start, __bss_end, which are Undefined
symbols in the code.

I want a way in the Reader to create specific atoms before the linker
bootstraps.

I didnt find a way to do that with the existing interfaces.

The way it needs to work is as below :-

1) ReaderELF creates Absolute symbols (for __bss_start, __bss_end etc)
2) ReaderELF reads each file and adds Atoms to the list
3) If the atoms the linker defined were Global, the atoms that the
Reader created should get overridden with the linker created ones.

This may also be needed to pul in specific symbols from archive
libraries, too.

I was thinking to add an interface to ReaderELF which would be called by
the driver, but the problem is the DefinedAtom/AbsoluteAtom have which
file owns the atom.

I was discussing with Michael on this, and he was proposing to add a
Pre-Read file.

Do you have any other opinions too ?