Merge "Move dl_unwind_find_exidx from libdl.a to libc.a"

This commit is contained in:
Ryan Prichard 2019-10-15 21:41:05 +00:00 committed by Gerrit Code Review
commit 1fee3b2104
3 changed files with 23 additions and 24 deletions

View file

@ -1525,6 +1525,22 @@ cc_library_static {
],
}
// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
// executable.
cc_library_static {
name: "libc_unwind_static",
defaults: ["libc_defaults"],
cflags: ["-DLIBC_STATIC"],
srcs: ["bionic/dl_iterate_phdr_static.cpp"],
arch: {
// arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
arm: {
srcs: ["arch-arm/bionic/exidx_static.c"],
},
},
}
// ========================================================
// libc_nomalloc.a
// ========================================================
@ -1537,20 +1553,13 @@ cc_library_static {
cc_library_static {
name: "libc_nomalloc",
defaults: ["libc_defaults"],
arch: {
arm: {
srcs: ["arch-arm/bionic/exidx_static.c"],
},
},
cflags: ["-DLIBC_STATIC"],
whole_static_libs: [
"libc_common_static",
"libc_init_static",
"libc_unwind_static",
],
}
@ -1572,7 +1581,6 @@ filegroup {
filegroup {
name: "libc_sources_static",
srcs: [
"bionic/dl_iterate_phdr_static.cpp",
"bionic/malloc_common.cpp",
"bionic/malloc_limit.cpp",
],
@ -1586,11 +1594,6 @@ filegroup {
],
}
filegroup {
name: "libc_sources_static_arm",
srcs: [ "arch-arm/bionic/exidx_static.c" ],
}
// ========================================================
// libc.a + libc.so
// ========================================================
@ -1613,6 +1616,7 @@ cc_library {
whole_static_libs: [
"libc_init_static",
"libc_common_static",
"libc_unwind_static",
],
},
shared: {
@ -1662,9 +1666,6 @@ cc_library {
// special for arm
cflags: ["-DCRT_LEGACY_WORKAROUND"],
},
static: {
srcs: [":libc_sources_static_arm"],
},
// Arm 32 bit does not produce complete exidx unwind information
// so keep the .debug_frame which is relatively small and does

View file

@ -43,7 +43,11 @@ struct exidx_entry {
extern struct exidx_entry __exidx_end;
extern struct exidx_entry __exidx_start;
_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc __attribute__((unused)), int* pcount) {
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc __attribute__((unused)), int* pcount) {
*pcount = (&__exidx_end - &__exidx_start);
return (_Unwind_Ptr)&__exidx_start;
}
_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc, int *pcount) {
return dl_unwind_find_exidx(pc, pcount);
}

View file

@ -41,9 +41,3 @@ int dladdr(const void* /*addr*/, Dl_info* /*info*/) {
int dlclose(void* /*handle*/) {
return -1;
}
#if defined(__arm__)
_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr /*pc*/, int* /*pcount*/) {
return 0;
}
#endif