Section names used in ELF linker scripts can be quoted, but such
quotes must not be propagated to the binary ELF section names. As
such strip the quotes from the section names when processing them, and
also strip them from linker script functions that take section names
as parameters.
Details
- Reviewers
ruiu MaskRay - Commits
- rG7cab385a8f4a: [lld/elf] support quote usage in section names
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the review, let me know if you agree with the reply. Will look into using split-file if that's desirable.
lld/test/ELF/linkerscript/section-quotes.test | ||
---|---|---|
20 | The point is to test all possible combinations of quoted section name definition and usage of quotes section names in functions. Hence the tree combinations for .text .data and .bss:
| |
24 | It's unused, but the point (here and in usages below) is to test that the SIZEOF function can correctly deal with quoted and unquoted section names. |
lld/test/ELF/linkerscript/section-quotes.test | ||
---|---|---|
20 | One LONG (ALIGNOF("...")) and one LONG (LOADADDR(".text")) are sufficient. No need to test LONG (ALIGNOF("...")) in two output section descriptions. | |
24 | OK, keeping text_size and data_text sounds good. But change llvm-readelf -S %t to llvm-readelf -S -s %t and additionally test the values of the two symbols. |
- Use split-file.
- Remove .bss test case.
- Test presence of {text,data}_size in the output.
- Add comment about purpose of tests.
[lld/elf] fix quote usage in section names
"Support " is more appropriate. We don't claim this was supported so we cannot consider this as a bug.
OK, I've used fix because GNU ld does support quoted section names, and lld claims to be compatible.
Can this be fixed at commit please? Are there any other steps I should do to get this committed?
Thanks
You may change the subject of the differential.
There are number of comments for tests which haven't been marked as done.
Since you approved the change I take you are happy with the code as-is, and marked all the comments as done. Thanks.
I adjusted the test a bit and landed it. Sorry for being so late. You can ping once per week if no response...
Use split-file to provide the linker script