After Mark's patch I was wondering what was the rationale for the ELF spec requiring us to merge only sections with matching flags and types. I tried emailing https://groups.google.com/forum/#!forum/generic-abi, but looks like my emails are not being posted (the list is probably moderated). I emailed Cary Coutant instead.
Cary pointed out that the section was a late addition and didn't got the scrutiny it deserved. Given that and the problems found by implementing the letter of the standard, I propose changing lld to merge all sections with the same name and issue errors if the types or some critical flags are different.
This should allow an unmodified firefox linked with lld to run.
This also merges some code with the linkerscript path.
It -> it