diff options
| author | Shankar Easwaran <shankare@codeaurora.org> | 2013-08-23 20:03:31 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankare@codeaurora.org> | 2013-08-23 20:03:31 +0000 |
| commit | 78457803bcde8a9504309f6da0df2ea60a4c4454 (patch) | |
| tree | 6d2709f2f43b2518c1d8327fc712155ad4c5e18e | |
| parent | d9e0a49357595adde2c12a5b55221cdfb090a896 (diff) | |
| download | bcm5719-llvm-78457803bcde8a9504309f6da0df2ea60a4c4454.tar.gz bcm5719-llvm-78457803bcde8a9504309f6da0df2ea60a4c4454.zip | |
[lld][ELF][Cleanup] Section associated with the relocation traversed
There is no change in functionality, this uses the defined way to access
the relocation section that belongs to a particular section.
llvm-svn: 189138
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/File.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lld/lib/ReaderWriter/ELF/File.h b/lld/lib/ReaderWriter/ELF/File.h index bac88c98c76..dcbcab65815 100644 --- a/lld/lib/ReaderWriter/ELF/File.h +++ b/lld/lib/ReaderWriter/ELF/File.h @@ -185,14 +185,12 @@ public: _sectionSymbols[section]; if (section->sh_type == llvm::ELF::SHT_RELA) { - auto sectionName = _objFile->getSectionName(section); + auto sHdr = _objFile->getSection(section->sh_info); + + auto sectionName = _objFile->getSectionName(sHdr); if (!sectionName) return error_code(sectionName); - // Get rid of the leading .rela so Atoms can use their own section - // name to find the relocs. - *sectionName = sectionName->drop_front(5); - auto rai(_objFile->begin_rela(section)); auto rae(_objFile->end_rela(section)); @@ -201,14 +199,12 @@ public: } if (section->sh_type == llvm::ELF::SHT_REL) { - auto sectionName = _objFile->getSectionName(section); + auto sHdr = _objFile->getSection(section->sh_info); + + auto sectionName = _objFile->getSectionName(sHdr); if (!sectionName) return error_code(sectionName); - // Get rid of the leading .rel so Atoms can use their own section - // name to find the relocs. - *sectionName = sectionName->drop_front(4); - auto ri(_objFile->begin_rel(section)); auto re(_objFile->end_rel(section)); |

