From 6f4bd532d3f7ba8b6070d5fe5e0da1130210ad90 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 6 Oct 2015 14:17:53 +0000 Subject: [PATCH] Rearrange a bit for clarity. NFC. llvm-svn: 249404 --- lld/ELF/OutputSections.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index ee2d87c1d100..5335cc5786dc 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -556,17 +556,14 @@ void SymbolTableSection::writeGlobalSymbols(uint8_t *&Buf) { ESym->setBindingAndType(Binding, InputSym.getType()); ESym->st_size = InputSym.st_size; ESym->setVisibility(Visibility); - if (InputSym.isAbsolute()) { - ESym->st_shndx = SHN_ABS; - ESym->st_value = InputSym.st_value; - } + ESym->st_value = getSymVA(EBody, BssSec); if (Section) Out = Section->getOutputSection(); - ESym->st_value = getSymVA(EBody, BssSec); - - if (Out) + if (InputSym.isAbsolute()) + ESym->st_shndx = SHN_ABS; + else if (Out) ESym->st_shndx = Out->getSectionIndex(); } if (!StrTabSec.isDynamic())