diff options
author | Dan Willemsen <dwillemsen@google.com> | 2018-10-15 15:40:49 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2018-10-22 22:52:25 +0000 |
commit | d6bf019204e258d89da56330fbcf9a36c39d23f5 (patch) | |
tree | 3302ba6e3d7023f565e911f876273824df6c70ee /libc/kernel/tools/cpp.py | |
parent | a8a716e42a8e6b8f28abf2b2f8f93b1e8579423d (diff) |
Rework the linker_wrapper to work with lld
This is use by Host Bionic to bootstrap into an embedded copy of the
linker by tweaking the AT_* values before calling in to the linker entry.
Similarly to 9729f35922aee4d1662b97d62d82385f6b8124ef, get the base
address from AT_PHDR, so that we're not relying on the relative offset
before relocation, which doesn't work with lld (at least with the
standard flags).
To find the offset to the linker code, we can still use an absolute
symbol created by extract_linker (which is currently hardcoded to 0x1000).
Instead of relying on something similar for the linker entry point,
we're now just reading the entry point from the linker's ELF header.
Then we get the address to the real _start function using
host_bionic_inject, which injects the value into a global variable after
the link step is finished. It also uses that opportunity to verify that
the linker is embedded as we expect it to be.
Bug: 31559095
Test: build with host bionic
Change-Id: I9d81ea77c51c079de06905da1ebe421fead1dc3b
Diffstat (limited to 'libc/kernel/tools/cpp.py')
0 files changed, 0 insertions, 0 deletions