Use ld -Map=xxx.map and check the output. (Intuitive, no explanation needed.)
*(x y) merges sections by placing matched sections in the order they found.
*(x) *(y) merges sections by placing sections x first, then y
When multiple sections are declared in one SECTIONS like
.foo : {}
.bar : {}
Which means .bar is placed after .foo. If you just want to merge sections respectively, do
SECTIONS {
.foo : {}
}
SECTIONS {
.bar : {}
}
When you specify one section in SECTIONS like
SECTIONS {
.data : {}
}
ld handles things about .data; other unmatched sections are not processed.