ldd: skip relocation processing, TLS modules, CFI
This avoids a diagnostic on arm32/arm64 when running ldd on a shared
library with a PT_TLS segment:
executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic
Bug: http://b/328822319
Test: ldd /system/lib64/libc.so
Change-Id: Idb061b980333ba3b5b3f44b52becf041d76ea0b7
diff --git a/linker/linker_relocate.cpp b/linker/linker_relocate.cpp
index 15d87ba..65b20f5 100644
--- a/linker/linker_relocate.cpp
+++ b/linker/linker_relocate.cpp
@@ -587,6 +587,11 @@
}
bool soinfo::relocate(const SymbolLookupList& lookup_list) {
+ // For ldd, don't apply relocations because TLS segments are not registered.
+ // We don't care whether ldd diagnoses unresolved symbols.
+ if (g_is_ldd) {
+ return true;
+ }
VersionTracker version_tracker;