Missing symbol __executable_start on Android when linking with LLD

When linking a project with lld, the android libc links to
__executable_start
which isn't defined when linking with lld (tried on x86), but is when
linking with gnu ld it seems.

I tried:

.globl __executable_start
__executable_start = __ehdr_start

as a workaround but seems to be ignored.

Anyone know a better workaround?

Thanks,

It is missing from lld.

Do you know what it should point to? The first executable PT_LOAD?

Thanks,
Rafael

Carlo Kok via llvm-dev <llvm-dev@lists.llvm.org> writes:

Android libc casts its address to the elf header type. So I think start of text?

Rafael Avila de Espindola rafael.espindola@gmail.com schreef op 30 mei 2017 20:51:19 CEST:

Carlo Kok <ck@remobjects.com> writes:

Android libc casts its address to the elf header type. So I think start of text?

Can you give https://reviews.llvm.org/D33700 a try?

Cheers,
Rafael

links fine now! thanks. I'm still a bit off for this code path to
actually hit, so I can't tell yet if it does what it's supposed to do.