[PATCH] D23598: [ELF] Linkerscript: support assignment outside SECTIONS

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 19:14:16 PDT 2016


phosek added inline comments.

================
Comment at: ELF/LinkerScript.h:70-72
@@ -69,2 +69,5 @@
   bool Hidden = false;
+
+  // Whether the "." is available.
+  bool DotAvailable = true;
 };
----------------
ruiu wrote:
> phosek wrote:
> > ruiu wrote:
> > > phosek wrote:
> > > > ruiu wrote:
> > > > > Let's remove this -- as I wrote in the previous comment, this is not an error we are detecting in other contexts, and it is okay to ignore them. I don't think it's a popular error, and it is "undefined behavior" (if there were the linker script language specification.)
> > > > I believe we still need some way to recognize whether the assignment is inside `SECTIONS` or not to avoid modifying `.` in case it's not when assigning addresses inside `assignAddress()`?
> > > Users shouldn't write an assignment outside SECTIONS with `.` as the RHS, so I don't think we need to worry too much about it.
> > The problem is if `.` is on LHS (in the assignment outside `SECTIONS`) because this will affect all subsequent assignments (even those within `SECTIONS`).
> Users shouldn't write `.` on LHS too, no?
No they shouldn't, but if they do, shall we just produce incorrect output? I guess that's probably fine since we're not reporting error anyway?


https://reviews.llvm.org/D23598





More information about the llvm-commits mailing list