A frequent error message we see is this one, resulting from incomplete
embedded linker scripts:
error: no memory region specified for loadable section `.eh_frame`
The attached test case demonstrates how it happens (.moredata in the
testcase). Orphan sections are placed into the default memory region.
This would result (e.g. with --no-check-sections) in their being
placed in the *default* memory region. The linker rightly complains;
the resulting binary is not useful. I've even managed to create
accidental overlays this way, where two of the LOAD segments have the
same address assigned.
The warning is sometimes useful (fix your linker script!) but also
contrary to the point of orphan placement. This seems like the right
fix but I would appreciate comments on it.
The patch is simple once you have the testcase: use AFTER to assign
regions (and phdrs - I think that's safe and I verified that this
doesn't place orphan notes in PT_INTERP).
What do you think?