| Index: tools/relocation_packer/src/main.cc
|
| diff --git a/tools/relocation_packer/src/main.cc b/tools/relocation_packer/src/main.cc
|
| index d5ff83c9b087d59d00846b454e1e09955f88a1e0..08a5a342ddbf802193aec9e0dc92fb9710afa266 100644
|
| --- a/tools/relocation_packer/src/main.cc
|
| +++ b/tools/relocation_packer/src/main.cc
|
| @@ -2,26 +2,23 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -// Tool to pack and unpack R_ARM_RELATIVE relocations in a shared library.
|
| +// Tool to pack and unpack ARM relative relocations in a shared library.
|
| //
|
| -// Packing removes R_ARM_RELATIVE relocations from .rel.dyn and writes them
|
| +// Packing removes ARM relative relocations from .rel.dyn and writes them
|
| // in a more compact form to .android.rel.dyn. Unpacking does the reverse.
|
| //
|
| // Invoke with -v to trace actions taken when packing or unpacking.
|
| -// Invoke with -p to pad removed relocations with R_ARM_NONE. Suppresses
|
| +// Invoke with -p to pad removed relocations with R_*_NONE. Suppresses
|
| // shrinking of .rel.dyn.
|
| // See PrintUsage() below for full usage details.
|
| //
|
| // NOTE: Breaks with libelf 0.152, which is buggy. libelf 0.158 works.
|
|
|
| -// TODO(simonb): Extend for 64-bit target libraries.
|
| -
|
| #include <errno.h>
|
| #include <fcntl.h>
|
| #include <getopt.h>
|
| #include <stdio.h>
|
| #include <stdlib.h>
|
| -#include <string.h>
|
| #include <sys/types.h>
|
| #include <unistd.h>
|
| #include <string>
|
| @@ -42,11 +39,11 @@ void PrintUsage(const char* argv0) {
|
|
|
| printf(
|
| "Usage: %s [-u] [-v] [-p] file\n"
|
| - "Pack or unpack R_ARM_RELATIVE relocations in a shared library.\n\n"
|
| - " -u, --unpack unpack previously packed R_ARM_RELATIVE relocations\n"
|
| + "Pack or unpack ARM relative relocations in a shared library.\n\n"
|
| + " -u, --unpack unpack previously packed ARM relative relocations\n"
|
| " -v, --verbose trace object file modifications (for debugging)\n"
|
| " -p, --pad do not shrink .rel.dyn, but pad (for debugging)\n\n"
|
| - "Extracts R_ARM_RELATIVE relocations from the .rel.dyn section, packs\n"
|
| + "Extracts ARM relative relocations from the .rel.dyn section, packs\n"
|
| "them into a more compact format, and stores the packed relocations in\n"
|
| ".android.rel.dyn. Expands .android.rel.dyn to hold the packed data,\n"
|
| "and shrinks .rel.dyn by the amount of unpacked data removed from it.\n\n"
|
| @@ -113,6 +110,8 @@ int main(int argc, char* argv[]) {
|
| LOG(WARNING) << "Elf Library is out of date!";
|
| }
|
|
|
| + LOG(INFO) << "Configured for " << ELF::Machine();
|
| +
|
| const char* file = argv[argc - 1];
|
| const int fd = open(file, O_RDWR);
|
| if (fd == -1) {
|
|
|