i386: Use -Ttext-segment to avoid address collision
authorBen Hutchings <ben@decadent.org.uk>
Sun, 6 Jan 2019 03:19:51 +0000 (03:19 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 6 Jan 2019 19:33:01 +0000 (19:33 +0000)
commit2281287145fadc430a572a662d80f9bd0df3b283
tree987309a0b5e584b77d5f12de95e401618d5f0514
parent73e8dc0f5d162109a550ec7e11c8d9d174f024c1
i386: Use -Ttext-segment to avoid address collision

Building klibc for i386 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 0000000000600000 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, similarly to x86_64.

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