[PATCH] D23769: [ELF] - Implemented --oformat binary option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 04:07:46 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Writer.cpp:1071-1072
@@ -1056,5 +1070,4 @@
 template <class ELFT> void Writer<ELFT>::assignAddresses() {
   uintX_t VA = Config->ImageBase + Out<ELFT>::ElfHeader->getSize() +
                Out<ELFT>::ProgramHeaders->getSize();
   uintX_t ThreadBssOffset = 0;
----------------
ruiu wrote:
> It seems to me that
> 
>   uintX_t VA = Config->ImageBase;
>   if (!OFormatBinary)
>     VA += Out<ELFT>::ElfHeader->getSize() +
>                Out<ELFT>::ProgramHeaders->getSize();
> 
> is easier to understand.
It is not only that place unfortunately. These sections are added to output sections as well and that brings more changes. I can update this patch to avoid 
```
if (Config->OFormat == OutputFormat::Elf)
      fixHeaders();
```
just to show the amount of changes required.


https://reviews.llvm.org/D23769





More information about the llvm-commits mailing list