[lld] r183816 - [ELF] NMAGIC support : Find the BSS section to setup the virtual address of _end.
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Jun 13 11:21:17 PDT 2013
testcase?
On 11 June 2013 20:32, Shankar Easwaran <shankare at codeaurora.org> wrote:
> Author: shankare
> Date: Tue Jun 11 19:32:35 2013
> New Revision: 183816
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183816&view=rev
> Log:
> [ELF] NMAGIC support : Find the BSS section to setup the virtual address of _end.
>
> Modified:
> lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h?rev=183816&r1=183815&r2=183816&view=diff
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/ExecutableWriter.h Tue Jun 11 19:32:35 2013
> @@ -118,16 +118,13 @@ template <class ELFT> void ExecutableWri
> endAtomIter == this->_layout->absoluteAtoms().end()) &&
> "Unable to find the absolute atoms that have been added by lld");
>
> - auto phe = this->_programHeader
> - ->findProgramHeader(llvm::ELF::PT_LOAD, llvm::ELF::PF_W, llvm::ELF::PF_X);
> + auto bssSection = this->_layout->findOutputSection(".bss");
>
> - assert(!(phe == this->_programHeader->rend()) &&
> - "Can't find a data segment in the program header!");
> -
> - (*bssStartAtomIter)->_virtualAddr = (*phe)->p_vaddr + (*phe)->p_filesz;
> - (*bssEndAtomIter)->_virtualAddr = (*phe)->p_vaddr + (*phe)->p_memsz;
> - (*underScoreEndAtomIter)->_virtualAddr = (*phe)->p_vaddr + (*phe)->p_memsz;
> - (*endAtomIter)->_virtualAddr = (*phe)->p_vaddr + (*phe)->p_memsz;
> + (*bssStartAtomIter)->_virtualAddr = bssSection->virtualAddr();
> + (*bssEndAtomIter)->_virtualAddr =
> + bssSection->virtualAddr() + bssSection->memSize();
> + (*underScoreEndAtomIter)->_virtualAddr = (*bssEndAtomIter)->_virtualAddr;
> + (*endAtomIter)->_virtualAddr = (*bssEndAtomIter)->_virtualAddr;
>
> // Give a chance for the target to finalize its atom values
> this->_targetHandler.finalizeSymbolValues();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list