[LLVMdev] Request for help: why does the program link correctly?

Tim Northover t.p.northover at gmail.com
Thu Jul 2 22:23:10 PDT 2015


On 2 July 2015 at 21:51, Nema, Ashutosh <Ashutosh.Nema at amd.com> wrote:
> Jim, I didn’t understood why foo is not marked with type 'FUNC'.

Just convention, as far as I can tell (certainly GNU as does the same
thing for undefined symbols).

The ARM ELF ABI says that either STT_NOTYPE or STT_FUNC would be
acceptable on that platform, the x86_64 ABI seems to be silent on the
issue.

> At least as per elf standard symbol foo should be marked as 'FUNC'
> STT_FUNC:    The symbol is associated with a function or other executable code.

For whatever reason, that's only taken to be necessary for defined
symbols in reality (you could argue that wording only says "STT_FUNC
=> function symbol", not "function symbol => STT_FUNC").

Cheers.

Tim.




More information about the llvm-dev mailing list