Open Quuxplusone opened 7 years ago
The document is indeed out of date. Synthetic sections are basically a catch-all section as you guessed. If you need to create a chunk of data that to be included in some section of the result, you want to create it as a synthetic section.
In reality, there are a few linker-synthesized chunks that are not of synthetic sections such as thunks. But we are rewriting them so that eventually they will become synthetic sections.
Synthetic sections were designed as input sections as opposed to output sections because we want to allow them to be manipulated using linker scripts.
What do you want to know about that? Feel free to ping me anytime.
Could you put that description in the header?
I was mostly just wondering what the common intuition was for why we had synthetic sections and what we used them for, and your description did a good job of that. I don't have any specific questions at this time.
The section https://lld.llvm.org/NewLLD.html does not describe synthetic sections. I would send a patch but I have to admit that I don't really understand their purpose very well (there are few comments in SyntheticSections.h).
It seems that they are basically a catch-all for any section created by the linker? Then the sentence "Since we have less synthesized data for ELF, we don’t abstract slices of input files as Chunks for ELF" seems out of date.