Commit 1ce08892 authored by simonb's avatar simonb Committed by Commit bot

Alter how relocation packing cuts holes from libchrome.so.

The current ELF file rewrite alters both offsets and addresses.
Altering addresses affects debugging tools such as breakpad.

This change leaves addresses unchanged, and instead splits a single
LOAD segment into two, leaving a mapping hole at the point where
the hole was created in the ELF file.  It works by repurposing the
PT_GNU_STACK segment, unused on Android.

The split into two LOAD segments no longer requires relocation
packing to adjust relocations or the symbol table, and in particular
means the the call frame information extracted by Dwarf DIE data
extractors for breakpad from an unstripped (and not packed) library
will match the stripped and packed one.

BUG=385553

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

Cr-Commit-Position: refs/heads/master@{#294413}
parent 8868b1d6
This diff is collapsed.
......@@ -57,6 +57,7 @@ struct ELF {
enum { kFileClass = ELFCLASS32 };
enum { kRelativeRelocationCode = R_ARM_RELATIVE };
enum { kNoRelocationCode = R_ARM_NONE };
enum { kGnuStackSegmentAlignment = 0 };
static inline const char* Machine() { return "ARM"; }
......@@ -90,6 +91,7 @@ struct ELF {
enum { kFileClass = ELFCLASS64 };
enum { kRelativeRelocationCode = R_AARCH64_RELATIVE };
enum { kNoRelocationCode = R_AARCH64_NONE };
enum { kGnuStackSegmentAlignment = 16 };
static inline const char* Machine() { return "ARM64"; }
......
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