https://sourceware.org/bugzilla/show_bug.cgi?id=32271

--- Comment #5 from Stas Sergeev <stsp at users dot sourceforge.net> ---
(In reply to Nick Clifton from comment #4)
> Sure - if the segment is referencing beyond the of the file then it is a
> bug.  But if not then it is more of an unexpected behaviour than a real
> fault.

Even if it covers some "random"
data in a file? IMHO that's still
a but. If it would be zero-sized
then fine. But its not.

> You could always strip these note sections from the object files *before*
> you link them together.

Hmm, that's an interesting trick I guess.
Its slightly more difficult to try out,
but worth a try eventually.

> Heresy!  The glibc loader is perfect!

Yeah, I know what you are talking about. :(
Been there.

> Have you tried linking with -Ttext=0xNNNNNNNN ?  (And/or --text-segment=X
> --rodata-segment=X --ldata-segment=X).

Just trued, and wtf?
$ x86_64-linux-gnu-ld int23.o int0.o asm.o ms.o plt.o -melf_i386 -static
/usr/local/i386-pc-dj64/lib/uplt.o --text-segment=0x08148000 -o tmp.elf
x86_64-linux-gnu-ld: unrecognized option '--text-segment=0x08148000'
x86_64-linux-gnu-ld: use the --help option for usage information

Wow, so lets try this then:
$ x86_64-linux-gnu-ld int23.o int0.o asm.o ms.o plt.o -melf_i386 -static
/usr/local/i386-pc-dj64/lib/uplt.o -text-segment=0x08148000 -o tmp.elf
x86_64-linux-gnu-ld: Error: unable to disambiguate: -text-segment=0x08148000
(did you mean --text-segment=0x08148000 ?)

Now it hints me to use -text-segment=0x08148000
only to declare it "unrecognized option"?
Very funny. :)

> Another possibility is to use your own linker script.  Not only could this
> script ensure that sections are loaded into the VA region you want, but you
> could also have it discard all of those unwanted debug and note sections too.

Another option that can actually work,
but is yet more difficult to try. When
I only need to change the default load
address. :)
Maybe fixing --text-segment or adding
some opt to set default load address is
a possibility?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to