x86_64: Use -Ttext-segment to avoid address collision
authorBen Hutchings <ben@decadent.org.uk>
Sat, 5 Jan 2019 20:59:33 +0000 (20:59 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 6 Jan 2019 19:33:01 +0000 (19:33 +0000)
commite5f52010f37c2ac8f4e341ce3d18e8ec84a55919
tree50d35bd1ade467fd746855088e95ca94d355ae6e
parent639698696a305a69921e8f70e4b9a7618ca5ebbd
x86_64: Use -Ttext-segment to avoid address collision

Building klibc for x86_64 with binutils 2.31 adds an extra
.note.gnu.property section to klibc.so, the address of which is not
affected by the -Ttext option.  Loading a klibc executable then
fails with the following kernel log message:

9409 (sh.shared): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already

I don't exactly see why this is happening, but it is triggered by the
new section and the collision can be avoided by passing -Ttext-segment
instead of -Ttext.  A similar change was applied to MIPS recently.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Name x86_64-use-ttext-segment-to-avoid-address-collision.patch
usr/klibc/arch/x86_64/MCONFIG