[PATCH] [lld] Correct forming of ARM/Thumb atoms
Denis Protivensky
dprotivensky at accesssoftek.com
Sun Jan 25 23:01:10 PST 2015
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMELFFile.h:56
@@ +55,3 @@
+ this->_symbol->st_shndx == llvm::ELF::SHN_COMMON) {
+ return DefinedAtom::Alignment(llvm::Log2_64(st_value));
+ } else if (this->_section->sh_addralign == 0) {
----------------
shankar.easwaran wrote:
> You are duplicating a lot of base class functionality
Okay, I'll introduce getSymbolValue as for ELFFile.
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMELFFile.h:86
@@ +85,3 @@
+
+ static bool isThumbFunc(const Elf_Sym *symbol) {
+ return symbol->getType() == llvm::ELF::STT_FUNC &&
----------------
shankar.easwaran wrote:
> Why static?
This function is more like a helper which doesn't affect object's state and doesn't contain any logic connected directly with ELFFile. The same one is in ARMELFDefinedAtom and the only reason I couldn't move it out of classes is that it uses class-level Elf_Sym typedef. If you don't like that, I'll make it a class's member.
================
Comment at: lib/ReaderWriter/ELF/ARM/ARMELFFile.h:157
@@ +156,3 @@
+ auto symContent = correctContentAddress(content, &symbol);
+ const auto symValue = correctSymbolStValue(&symbol);
+ for (const auto &rel : rels) {
----------------
shankar.easwaran wrote:
> Add a base class function getSymbolValue and you can override that in ARM.
Agree.
http://reviews.llvm.org/D7161
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list