[PATCH] D24230: [ELF] Linkerscript: Fix handling of empty sections

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 00:51:19 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.cpp:327
@@ +326,3 @@
+    Regular->Value = AssignCmd->Expression(VA);
+  }
+}
----------------
ruiu wrote:
> Could you answer to this question?
I thin I've already answered it:

> Linker script processor sets VA for empty sections to allow calculating ALIGNOF, SIZEOF and ADDR for them

I want the following script to be processed without errors:


```
. = 0x10000;
.absolutely_empty_section : {}
sym1 = ADDR(.absolutely_empty_section); // Will return 0x10000
sym2 = SIZEOF(.absolutely_empty_section); // Will return 0
sym3 = ALIGNOF(.absolutely_empty_section); // Will return 1
```
Please also look at the test case



https://reviews.llvm.org/D24230





More information about the llvm-commits mailing list