aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-14 01:01:19 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-14 01:01:19 +0000
commit37274da1bd5f3bb2259c0edd6aff767c3998af73 (patch)
treedfc0daea1ad44556b777262a980de027ebb13220
parent4b15ac0610010b68086ef3b7f6e82db9195fbb13 (diff)
parenta3b1926d75c2e46083429ae1e952035480dc3221 (diff)
downloadbionic-37274da1bd5f3bb2259c0edd6aff767c3998af73.tar.gz
Snap for 7360053 from a3b1926d75c2e46083429ae1e952035480dc3221 to sc-release
Change-Id: I29805b4941c451809a289a530feb9a4cd4501c7d
-rw-r--r--libc/arch-arm/bionic/__bionic_clone.S2
-rw-r--r--libc/arch-common/bionic/crtbegin.c10
-rw-r--r--libc/arch-x86/bionic/__bionic_clone.S1
-rw-r--r--libc/malloc_debug/PointerData.cpp4
-rw-r--r--libc/malloc_debug/UnwindBacktrace.cpp10
5 files changed, 16 insertions, 11 deletions
diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S
index 6669b93a2..3fe212b47 100644
--- a/libc/arch-arm/bionic/__bionic_clone.S
+++ b/libc/arch-arm/bionic/__bionic_clone.S
@@ -61,6 +61,8 @@ ENTRY_PRIVATE(__bionic_clone)
b __set_errno_internal
.L_bc_child:
+ # We're in the child now. Set the end of the frame record chain.
+ mov fp, #0
# Setting lr to 0 will make the unwinder stop at __start_thread.
mov lr, #0
# Call __start_thread with the 'fn' and 'arg' we stored on the child stack.
diff --git a/libc/arch-common/bionic/crtbegin.c b/libc/arch-common/bionic/crtbegin.c
index 628783789..5f681c53c 100644
--- a/libc/arch-common/bionic/crtbegin.c
+++ b/libc/arch-common/bionic/crtbegin.c
@@ -49,13 +49,15 @@ __used static void _start_main(void* raw_args) {
#define POST "; .size _start, .-_start"
#if defined(__aarch64__)
-__asm__(PRE "bti j; mov x0,sp; b _start_main" POST);
+__asm__(PRE "bti j; mov x29,#0; mov x30,#0; mov x0,sp; b _start_main" POST);
#elif defined(__arm__)
-__asm__(PRE "mov r0,sp; b _start_main" POST);
+__asm__(PRE "mov fp,#0; mov lr,#0; mov r0,sp; b _start_main" POST);
#elif defined(__i386__)
-__asm__(PRE "movl %esp,%eax; andl $~0xf,%esp; subl $12,%esp; pushl %eax; calll _start_main" POST);
+__asm__(PRE
+ "xorl %ebp,%ebp; movl %esp,%eax; andl $~0xf,%esp; subl $12,%esp; pushl %eax;"
+ "calll _start_main" POST);
#elif defined(__x86_64__)
-__asm__(PRE "movq %rsp,%rdi; andq $~0xf,%rsp; callq _start_main" POST);
+__asm__(PRE "xorl %ebp, %ebp; movq %rsp,%rdi; andq $~0xf,%rsp; callq _start_main" POST);
#else
#error unsupported architecture
#endif
diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S
index b682b4863..f0c58a00d 100644
--- a/libc/arch-x86/bionic/__bionic_clone.S
+++ b/libc/arch-x86/bionic/__bionic_clone.S
@@ -45,6 +45,7 @@ ENTRY_PRIVATE(__bionic_clone)
.L_bc_child:
# We don't want anyone to unwind past this point.
.cfi_undefined %eip
+ .cfi_undefined %ebp
call __start_thread
hlt
diff --git a/libc/malloc_debug/PointerData.cpp b/libc/malloc_debug/PointerData.cpp
index 4f81ff7ff..90c913638 100644
--- a/libc/malloc_debug/PointerData.cpp
+++ b/libc/malloc_debug/PointerData.cpp
@@ -588,8 +588,8 @@ void PointerData::DumpLiveToFile(int fd) {
dprintf(fd, " bt_info");
for (const auto& frame : *info.backtrace_info) {
dprintf(fd, " {");
- if (frame.map_info != nullptr && !frame.map_info->name.empty()) {
- dprintf(fd, "\"%s\"", frame.map_info->name.c_str());
+ if (frame.map_info != nullptr && !frame.map_info->name().empty()) {
+ dprintf(fd, "\"%s\"", frame.map_info->name().c_str());
} else {
dprintf(fd, "\"\"");
}
diff --git a/libc/malloc_debug/UnwindBacktrace.cpp b/libc/malloc_debug/UnwindBacktrace.cpp
index 92fb3fa96..128991bd9 100644
--- a/libc/malloc_debug/UnwindBacktrace.cpp
+++ b/libc/malloc_debug/UnwindBacktrace.cpp
@@ -90,14 +90,14 @@ void UnwindLog(const std::vector<unwindstack::LocalFrameData>& frame_info) {
unwindstack::MapInfo* map_info = info->map_info;
std::string line = android::base::StringPrintf(" #%0zd pc %" PAD_PTR " ", i, info->rel_pc);
- if (map_info->offset != 0) {
- line += android::base::StringPrintf("(offset 0x%" PRIx64 ") ", map_info->offset);
+ if (map_info->offset() != 0) {
+ line += android::base::StringPrintf("(offset 0x%" PRIx64 ") ", map_info->offset());
}
- if (map_info->name.empty()) {
- line += android::base::StringPrintf("<anonymous:%" PRIx64 ">", map_info->start);
+ if (map_info->name().empty()) {
+ line += android::base::StringPrintf("<anonymous:%" PRIx64 ">", map_info->start());
} else {
- line += map_info->name;
+ line += map_info->name();
}
if (!info->function_name.empty()) {