gnu-phdrs.test uses 2 precompiled objects and has issues:
- It does not test all possible program headers.
- It does not test target-specific headers (arm, mips).
- It does not use --strict-whitespace --match-full-line to check the format of the output.
- It is possible to check things better/nicer.
- It also tests --section-mapping.
This patch makes gnu-phdrs.test to stop using binaries and addresses issues above.
It splits --section-mapping testing to gnu-section-mapping.test
I am going to use it as a base for a follow-up patch that should also test
section to segment mapping conditions that we currently have
(see the discussion in D78709)
I'd be inclined to move this case into the section mapping test, and then simplify it down to show that program headers are emitted (but no need to check the full output). That way, the "Section to Segment mapping:" implicit-check-not is going to be closer to the true case, and less likely to get broken at some future point.