[PATCH] [ELF]: Initial implementation for ARM static linking
Simon Atanasyan
simon at atanasyan.com
Fri Nov 28 23:34:16 PST 2014
Just curious, does the only test case cover the most part of new functionality?
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMELFFile.h:25
@@ +24,3 @@
+
+ ARMELFFile(std::unique_ptr<MemoryBuffer> mb, bool atomizeStrings,
+ std::error_code &ec)
----------------
Strange indentation here. I recommend you to run the `clang-format` other all new files.
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMELFFile.h:103-108
@@ +102,8 @@
+ return readAddend_THM_CALL(ap);
+ case llvm::ELF::R_ARM_CALL:
+ case llvm::ELF::R_ARM_JUMP24:
+ return readAddend_ARM_CALL(ap);
+ case llvm::ELF::R_ARM_THM_MOVW_ABS_NC:
+ case llvm::ELF::R_ARM_THM_MOVT_ABS:
+ return readAddend_THM_MOV(ap);
+ case llvm::ELF::R_ARM_THM_JUMP11:
----------------
shankarke wrote:
> All of the above would need to be done in the relocation handler. We should not interpret the bits in the Reader, this way the Reader is agnostic to the symbol value.
>
>
But the relocation handler does not know about used relocation section format (.rel/.rela) so it cannot decide how and where to read an addendum. So I think it is a good approach to read addendums here, construct `Reference` objects, and call the `Reference::addend()` method further.
http://reviews.llvm.org/D6446
More information about the llvm-commits
mailing list