[PATCH] D19190: [ELF] - Implemented PROVIDE linker script command.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 13:29:49 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:252-253
@@ +251,4 @@
+  // begin and end of the section.
+  StringRef SecName;
+  uintX_t Val;
+  for (SectionsCommand &Cmd : Commands) {
----------------
Move this inside the for loop to make their scopes as narrow as possible.

================
Comment at: ELF/LinkerScript.h:48-51
@@ +47,6 @@
+// * SectionKind is a description of output section, like ".data :..."
+// * ContentKind is a content of output section, it helps to distinguish PROVIDE
+//   command before and after section content, first one should have address
+//   equal to address of output section, second points to location after that.
+// * ProvideKind is PROVIDE command.
+enum SectionsCommandKind { ExprKind, SectionKind, ContentKind, ProvideKind };
----------------
ContentKind is very confusing and seems unnecessary. Why don't you process ProvideKind elements in assignAddresses? You should be able to define symbols using the current VA in the function.


http://reviews.llvm.org/D19190





More information about the llvm-commits mailing list