[PATCH] D25014: [ELF] Change the way we compute file offsets

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 04:27:01 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Writer.cpp:1055
@@ -1052,3 +1054,3 @@
     if (!(Sec->getFlags() & SHF_ALLOC))
-      break;
+      continue;
 
----------------
Why do you need this ?

================
Comment at: ELF/Writer.cpp:1206
@@ -1193,2 +1205,3 @@
+                        First->getFileOffset() + Sec->getVA() - First->getVA());
 }
 
----------------
I think this looks nicer in 2 lines:

```
if (!First || Sec == First)
  return alignTo(Off, Target->MaxPageSize, Sec->getVA());
return std::max(Off, First->getFileOffset() + Sec->getVA() - First->getVA());
```

================
Comment at: ELF/Writer.cpp:1225
@@ -1211,2 +1224,3 @@
       setOffset(Sec, Off);
+
   FileSize = alignTo(Off, sizeof(uintX_t));
----------------
Excessive line.


Repository:
  rL LLVM

https://reviews.llvm.org/D25014





More information about the llvm-commits mailing list