[PATCH] D22683: [ELF] Symbol assignment within input section list

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 01:05:16 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.cpp:359-361
@@ +358,5 @@
+    }
+    // Update section size, so that SIZEOF works correctly in the case below:
+    // .foo { ... a = SIZEOF(.foo) ... }
+    Sec->setSize(Off);
+  }
----------------
ruiu wrote:
> Do you have to do this in this for-loop? It seems that you can do this only once after this for-loop.
I'm evaluating symbols in this for-loop, so I need to have actual size, in case there is SIZEOF() in expression, i.e


```
.foo : {
   *(.aaa)
    size_1 = sizeof(.foo); /* size_1 is sizeof (*.aaa) */
   *(.bbb)
    size_2 = sizeof(.foo); /* size_2 is sizeof (*.aaa) + sizeof (.bbb) */
}
```


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list