[PATCH] D43819: [ELF] - Restrict section offsets that exceeds file size.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 01:25:00 PST 2018


jhenderson added inline comments.


================
Comment at: ELF/Writer.cpp:1907
+  // Our logic assumes that sections have rising VA within the same segment.
+  // With use of linker script it is possible to violate this rule and get file
+  // offset overlaps or overflows. That should never happen in a valid script
----------------
use of linker script -> use of linker scripts


================
Comment at: ELF/Writer.cpp:1909
+  // offset overlaps or overflows. That should never happen in a valid script
+  // which does not move location counter backwards and usually scripts do not
+  // do that. Unfortunately, there are apps in the wild, for example, Linux
----------------
move location counter -> move the location counter


================
Comment at: ELF/Writer.cpp:1910-1911
+  // which does not move location counter backwards and usually scripts do not
+  // do that. Unfortunately, there are apps in the wild, for example, Linux
+  // kernel which controls segments distribution explicitly and moves counter
+  // backwards so we have to allow doing that to support linking them. We
----------------
Linux kernel which controls segments -> Linux kernel, which control segment
moves counter backwards so -> moves the counter backwards, so


https://reviews.llvm.org/D43819





More information about the llvm-commits mailing list