Delete getSectionHdr.
We were fairly inconsistent as to what information should be accessed
with getSectionHdr and what information (like alignment) was stored
elsewhere.
Now all section info has a dedicated getter. The code is also a bit
more compact.
llvm-svn: 285079
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 62f81f7..a75e9db 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -132,7 +132,7 @@
InputSectionBase<ELFT> &C,
typename ELFT::uint Offset,
typename ELFT::uint Addend, RelExpr Expr) {
- if (!(C.getSectionHdr()->sh_flags & SHF_ALLOC))
+ if (!(C.getFlags() & SHF_ALLOC))
return 0;
if (!Body.isTls())
@@ -558,7 +558,7 @@
static void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
typedef typename ELFT::uint uintX_t;
- bool IsWrite = C.getSectionHdr()->sh_flags & SHF_WRITE;
+ bool IsWrite = C.getFlags() & SHF_WRITE;
auto AddDyn = [=](const DynamicReloc<ELFT> &Reloc) {
Out<ELFT>::RelaDyn->addReloc(Reloc);