Commit 5a082166 authored by simonb@chromium.org's avatar simonb@chromium.org

Switch from ELF CPU-specific to OS-specific DT_ tags.

Use the OS-specific range for packed relocation extension DT_ tags.
Name throughout as DT_ANDROID_REL_ rather than DT_ANDROID_ARM_REL_.
Change test data to match.

BUG=385553

Review URL: https://codereview.chromium.org/407093003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285179 0039d316-1c4b-4281-b951-d872f2087c98
parent 88c0c319
......@@ -31,3 +31,5 @@ Local Modifications:
- Improve permission denied message to mention upgrading from L-preview.
- Fix for crbug/394306 (Chrome crashes during startup ... on Arm64 AAW15)
- Move packed relocation dynamic tags from DT_LOPROC range to DT_LOOS range.
......@@ -58,11 +58,15 @@
#define DT_PREINIT_ARRAYSZ 33
#endif
// Processor-specific extension dynamic tags for packed relocations.
#ifndef DT_LOOS
#define DT_LOOS 0x6000000d
#endif
// Extension dynamic tags for packed relocations.
#ifdef __arm__
#define DT_ANDROID_ARM_REL_OFFSET (DT_LOPROC)
#define DT_ANDROID_ARM_REL_SIZE (DT_LOPROC + 1)
#define DT_ANDROID_REL_OFFSET (DT_LOOS)
#define DT_ANDROID_REL_SIZE (DT_LOOS + 1)
#endif // __arm__
......@@ -336,13 +340,13 @@ bool SharedLibrary::Load(const char* full_path,
has_DT_SYMBOLIC_ = true;
break;
#if defined(__arm__)
case DT_ANDROID_ARM_REL_OFFSET:
case DT_ANDROID_REL_OFFSET:
arm_packed_relocs_offset = dyn.GetOffset();
LOG(" DT_ANDROID_ARM_REL_OFFSET addr=%p\n", arm_packed_relocs_offset);
LOG(" DT_ANDROID_REL_OFFSET addr=%p\n", arm_packed_relocs_offset);
break;
case DT_ANDROID_ARM_REL_SIZE:
case DT_ANDROID_REL_SIZE:
arm_packed_relocs_size = dyn.GetValue();
LOG(" DT_ANDROID_ARM_REL_SIZE=%d\n", arm_packed_relocs_size);
LOG(" DT_ANDROID_REL_SIZE=%d\n", arm_packed_relocs_size);
break;
#endif
#if defined(__mips__)
......
......@@ -31,9 +31,9 @@ Unpacking on the device requires the explicit support of an extended crazy
linker. Adds the following new .dynamic tags, used by the crazy linker to
find the packed .android.rel.dyn section data:
DT_ANDROID_ARM_REL_OFFSET = DT_LOPROC (Processor specific: 0x70000000)
DT_ANDROID_REL_OFFSET = DT_LOOS (Operating System specific: 0x6000000d)
- The offset of .android.rel.dyn data in libchrome.<version>.so
DT_ANDROID_ARM_REL_SIZE = DT_LOPROC + 1 (Processor Specific: 0x70000001)
DT_ANDROID_REL_SIZE = DT_LOOS + 1 (Operating System Specific: 0x6000000e)
- The size of .android.rel.dyn data in bytes
The format of .android.rel.dyn data is:
......
......@@ -22,8 +22,8 @@ static const uint32_t kStubIdentifier = 0x4c4c554eu;
// Out-of-band dynamic tags used to indicate the offset and size of the
// .android.rel.dyn section.
static const ELF::Sword DT_ANDROID_REL_OFFSET = DT_LOPROC;
static const ELF::Sword DT_ANDROID_REL_SIZE = DT_LOPROC + 1;
static const ELF::Sword DT_ANDROID_REL_OFFSET = DT_LOOS;
static const ELF::Sword DT_ANDROID_REL_SIZE = DT_LOOS + 1;
// Alignment to preserve, in bytes. This must be at least as large as the
// largest d_align and sh_addralign values found in the loaded file.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment