[PATCH] D25799: Include version string into ".linker-version" section.

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 04:22:20 PDT 2016

peter.smith added a comment.

The contents of the .linker-version section and the code create it look good to me.

My only question given that .linker-version is SHT_PROGBITS is why use a separate .linker-version section rather than just add to the pre-existing .comment section? For example in a test file built using objects from clang and gcc I get a .comment section out of lld that looks like: 
`Contents of section .comment:`
` 0000 00474343 3a20284c 696e6172 6f204743  .GCC: (Linaro GC`
` 0010 4320352e 332d3230 31362e30 32292035  C 5.3-2016.02) 5`
` 0020 2e332e31 20323031 36303131 3300636c  .3.1 20160113.cl`
` 0030 616e6720 76657273 696f6e20 342e302e  ang version 4.0.`
` 0040 302000                               0 .             `

Putting the information from .linker-version in the .comment section collects all the version control information for the toolchain in one place.

Having said all that I don't have a strong opinion and I'm happy to go with .linker-version if others prefer.


More information about the llvm-commits mailing list