summaryrefslogtreecommitdiff
path: root/libc/startup/linux/do_start.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/startup/linux/do_start.cpp')
-rw-r--r--libc/startup/linux/do_start.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libc/startup/linux/do_start.cpp b/libc/startup/linux/do_start.cpp
index 55fd575f7ad0..30ab1f0e26ea 100644
--- a/libc/startup/linux/do_start.cpp
+++ b/libc/startup/linux/do_start.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
#include "startup/linux/do_start.h"
+#include "include/llvm-libc-macros/link-macros.h"
#include "src/__support/OSUtil/syscall.h"
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
@@ -68,8 +69,8 @@ static ThreadAttributes main_thread_attrib;
// After the argv array, is a 8-byte long NULL value before the array of env
// values. The end of the env values is marked by another 8-byte long NULL
// value. We step over it (the "+ 1" below) to get to the env values.
- ArgVEntryType *env_ptr = app.args->argv + app.args->argc + 1;
- ArgVEntryType *env_end_marker = env_ptr;
+ uintptr_t *env_ptr = app.args->argv + app.args->argc + 1;
+ uintptr_t *env_end_marker = env_ptr;
app.env_ptr = env_ptr;
while (*env_end_marker)
++env_end_marker;
@@ -79,13 +80,13 @@ static ThreadAttributes main_thread_attrib;
// After the env array, is the aux-vector. The end of the aux-vector is
// denoted by an AT_NULL entry.
- Elf64_Phdr *program_hdr_table = nullptr;
+ ElfW(Phdr) *program_hdr_table = nullptr;
uintptr_t program_hdr_count = 0;
app.auxv_ptr = reinterpret_cast<AuxEntry *>(env_end_marker + 1);
for (auto *aux_entry = app.auxv_ptr; aux_entry->id != AT_NULL; ++aux_entry) {
switch (aux_entry->id) {
case AT_PHDR:
- program_hdr_table = reinterpret_cast<Elf64_Phdr *>(aux_entry->value);
+ program_hdr_table = reinterpret_cast<ElfW(Phdr) *>(aux_entry->value);
break;
case AT_PHNUM:
program_hdr_count = aux_entry->value;
@@ -100,10 +101,10 @@ static ThreadAttributes main_thread_attrib;
ptrdiff_t base = 0;
app.tls.size = 0;
- Elf64_Phdr *tls_phdr = nullptr;
+ ElfW(Phdr) *tls_phdr = nullptr;
for (uintptr_t i = 0; i < program_hdr_count; ++i) {
- Elf64_Phdr &phdr = program_hdr_table[i];
+ ElfW(Phdr) &phdr = program_hdr_table[i];
if (phdr.p_type == PT_PHDR)
base = reinterpret_cast<ptrdiff_t>(program_hdr_table) - phdr.p_vaddr;
if (phdr.p_type == PT_DYNAMIC && _DYNAMIC)