forked from OSchip/llvm-project
[libc][Obvious] Remove an unnecessary dep and use inline_memcpy.
An unnecessary dep of the getenv function is removed. From the x86_64 loader, a call to __llvm_libc::memcpy is replaced with call to __llvm_libc::inline_memcpy.
This commit is contained in:
parent
902f4708fe
commit
b950a0d44d
|
@ -7,7 +7,7 @@ add_loader_object(
|
||||||
libc.include.sys_mman
|
libc.include.sys_mman
|
||||||
libc.include.sys_syscall
|
libc.include.sys_syscall
|
||||||
libc.src.__support.OSUtil.osutil
|
libc.src.__support.OSUtil.osutil
|
||||||
libc.src.string.memcpy
|
libc.src.string.memory_utils.memcpy_implementation
|
||||||
COMPILE_OPTIONS
|
COMPILE_OPTIONS
|
||||||
-fno-omit-frame-pointer
|
-fno-omit-frame-pointer
|
||||||
-ffreestanding # To avoid compiler warnings about calling the main function.
|
-ffreestanding # To avoid compiler warnings about calling the main function.
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include "config/linux/app.h"
|
#include "config/linux/app.h"
|
||||||
#include "src/__support/OSUtil/syscall.h"
|
#include "src/__support/OSUtil/syscall.h"
|
||||||
#include "src/string/memcpy.h"
|
#include "src/string/memory_utils/memcpy_implementations.h"
|
||||||
|
|
||||||
#include <asm/prctl.h>
|
#include <asm/prctl.h>
|
||||||
#include <linux/auxvec.h>
|
#include <linux/auxvec.h>
|
||||||
|
@ -64,7 +64,8 @@ void initTLS() {
|
||||||
uintptr_t endPtr = reinterpret_cast<uintptr_t>(tlsAddr) + tlsSize;
|
uintptr_t endPtr = reinterpret_cast<uintptr_t>(tlsAddr) + tlsSize;
|
||||||
*reinterpret_cast<uintptr_t *>(endPtr) = endPtr;
|
*reinterpret_cast<uintptr_t *>(endPtr) = endPtr;
|
||||||
|
|
||||||
__llvm_libc::memcpy(tlsAddr, reinterpret_cast<const void *>(app.tls.address),
|
__llvm_libc::inline_memcpy(reinterpret_cast<char *>(tlsAddr),
|
||||||
|
reinterpret_cast<const char *>(app.tls.address),
|
||||||
app.tls.size);
|
app.tls.size);
|
||||||
if (__llvm_libc::syscall(SYS_arch_prctl, ARCH_SET_FS, endPtr) == -1)
|
if (__llvm_libc::syscall(SYS_arch_prctl, ARCH_SET_FS, endPtr) == -1)
|
||||||
__llvm_libc::syscall(SYS_exit, 1);
|
__llvm_libc::syscall(SYS_exit, 1);
|
||||||
|
|
|
@ -46,7 +46,6 @@ add_entrypoint_object(
|
||||||
getenv.h
|
getenv.h
|
||||||
DEPENDS
|
DEPENDS
|
||||||
libc.config.linux.app_h
|
libc.config.linux.app_h
|
||||||
libc.src.string.strncmp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_entrypoint_object(
|
add_entrypoint_object(
|
||||||
|
|
Loading…
Reference in New Issue