Hi!
As author of the HotBasic compiler for Windows, in porting same
to Linux, I find that ld does not properly link relative
relocations (R_386_PC32) in correct elf32-i386 .o files.
In particular, after opcode E8h (call), ld inserts a relative
value which is 4 bytes too much, as if it did not tak
Long, long ago, Ian Lance Taylor, a life form in far off space,
emitted:
>doctor electron <[EMAIL PROTECTED]> writes:
>
>> As author of the HotBasic compiler for Windows, in porting same
>> to Linux, I find that ld does not properly link relative
>> relocations (R_3
Long, long ago, Ian Lance Taylor, a life form in far off space,
emitted:
>the four bytes affected by R_386_PC32
Dear Ian, I think a single statement edit would fix ld re rel
relocs: The place where we read the "four bytes affected" now
is the equivalent of
x = [the four bytes] ...or... mov eax
Long, long ago, Eric Botcazou, a life form in far off space,
emitted:
>Interesting. Then your next task is to convince the dumb guys at Sun too
>because their toolchain behaves exactly like the Linux toolchain...
Thanks for this info, Eric.
As you might see in Ian's thoughtful reply, I don't
Long, long ago, Eric Botcazou, a life form in far off space,
emitted:
>neither you nor us can change it now
Thanks for your further thoughts -- and even bigger story!
The answer to that is pending; I hope we can edit ld to not
require -4 in those rel reloc locations in input files.
If so, the m
Long, long ago, Eric Botcazou, a life form in far off space,
emitted:
>> If so, the market will decide; is a corrected ld favored or not.
>
>It's already decided: your proposed change would break the ABI, hence break
>binary compatibility by definition.
The ABI states linkers cannot make -4 them
Long, long ago, Ian Lance Taylor, a life form in far off space,
emitted:
>If you ignore the contents of the .o file, then how do you propose to
>handle the assembler code
>call foo + 16
>?
Very good question. Thank you. Apparently the ABI assemblers
would put foo's address in the rel reloc
Long, long ago, Ian Lance Taylor, a life form in far off space,
emitted:
>If you ignore the contents of the .o file, then how do you propose to
>handle the assembler code
>call foo + 16
>?
ADDENDUM:
Thanks again for this implied explanation, where apparently rel
reloc info is split in two par
Long, long ago, Ian Lance Taylor, a life form in far off space,
emitted:
>We would discard the ABI in a second if the benefit exceeds the cost.
We agree; I'm happy.
>What benefit would we gain by changing the definition of R_386_PC32?
As stated, I don't know; the case was discussed as an exampl