summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-01-24 14:36:10 -0800
committerElliott Hughes <enh@google.com>2020-01-24 15:39:01 -0800
commit6663f5525dafc31de1891d7e0fa6da88c4c7dc4b (patch)
tree20be89b877823e6c2c3521037aa4a21f6bcb0345 /linker/linker.cpp
parent5b9cc3144239511ec9062a3ff47dc20202848388 (diff)
Modernize SHT_RELR support.
Until now we've only supported RELR with our own OS-private-use constants. Add support for the official numbers (while maintaining support for the historical numbers). Add tests to ensure we continue to support both indefinitely. We can't yet flip the build system over to using the official constants because the old GNU binutils objcopy we still use in most cases (for the mini-debug section) only supports the historical constants. Bug: http://b/147452927 Test: treehugger Change-Id: If214fce7fade4316115947e90b78ab40864b61f2
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 57554fb92..8de82d543 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3070,14 +3070,17 @@ bool soinfo::prelink_image() {
#endif
case DT_RELR:
+ case DT_ANDROID_RELR:
relr_ = reinterpret_cast<ElfW(Relr)*>(load_bias + d->d_un.d_ptr);
break;
case DT_RELRSZ:
+ case DT_ANDROID_RELRSZ:
relr_count_ = d->d_un.d_val / sizeof(ElfW(Relr));
break;
case DT_RELRENT:
+ case DT_ANDROID_RELRENT:
if (d->d_un.d_val != sizeof(ElfW(Relr))) {
DL_ERR("invalid DT_RELRENT: %zd", static_cast<size_t>(d->d_un.d_val));
return false;
@@ -3085,7 +3088,8 @@ bool soinfo::prelink_image() {
break;
// Ignored (see DT_RELCOUNT comments for details).
- case DT_RELRCOUNT:
+ // There is no DT_RELRCOUNT specifically because it would only be ignored.
+ case DT_ANDROID_RELRCOUNT:
break;
case DT_INIT: