Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Documentation does not mention synthetic sections #30690

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR31717
Status NEW
Importance P normal
Reported by Sean Silva (silvasean@google.com)
Reported on 2017-01-21 21:34:16 -0800
Last modified on 2018-06-17 04:28:41 -0700
Version unspecified
Hardware PC Linux
CC emaste@freebsd.org, llvm-bugs@lists.llvm.org, ruiu@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

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.

Quuxplusone commented 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.

Quuxplusone commented 7 years ago

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.