Previously, it was difficult to write code that handled both synthetic
and regular sections generically. We solve this problem by creating a
fake InputSection at the start of every SyntheticSection.
This refactor allows us to handle DSOHandle like a regular Defined
symbol (since Defined symbols must be attached to an InputSection), and
paves the way for supporting __mh_*header symbols. Additionally, it
simplifies our binding/rebase code.
I did have to extend Defined a little -- it now has a linkerInternal
flag, to indicate that ___dso_handle should not be in the final symbol
table.
I've also added some additional testing for ___dso_handle.
clang-tidy: warning: 'auto s' can be declared as 'auto *s' [llvm-qualified-auto]