Remove host_bionic_inject
Now that linker_wrapper.o does not use objcopy --prefix-symbols=__dlwrap_ it can reference the _start symbol of the original binary without colliding with its own __dlwrap__start symbol, which means host_bionic_inject is no longer necessary. Test: build and run host bionic binary Change-Id: I1752efa39fa73a092fab039771bf59c99b7b5974
This commit is contained in:
parent
a0a591a714
commit
331b3887f4
1 changed files with 6 additions and 4 deletions
|
@ -28,11 +28,13 @@
|
|||
|
||||
#include "private/KernelArgumentBlock.h"
|
||||
|
||||
// The offset from the linker's original program header load addresses to
|
||||
// the load addresses when embedded into a binary. Set by the extract_linker
|
||||
// tool.
|
||||
extern const char __dlwrap_linker_offset;
|
||||
|
||||
// This will be replaced by host_bionic_inject, but must be non-zero
|
||||
// here so that it's placed in the data section.
|
||||
uintptr_t __dlwrap_original_start = 42;
|
||||
// The real entry point of the binary to use after linker bootstrapping.
|
||||
__LIBC_HIDDEN__ extern "C" void _start();
|
||||
|
||||
/* Find the load bias and base address of an executable or shared object loaded
|
||||
* by the kernel. The ELF file's PHDR table must have a PT_PHDR entry.
|
||||
|
@ -73,7 +75,7 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) {
|
|||
}
|
||||
if (v->a_type == AT_ENTRY) {
|
||||
// Set AT_ENTRY to the proper entry point
|
||||
v->a_un.a_val = base_addr + __dlwrap_original_start;
|
||||
v->a_un.a_val = reinterpret_cast<ElfW(Addr)>(&_start);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue