This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86: adjust relocation overflow complaint types


Michael Matz <matz@suse.de> writes:

> But linking will fail:
>
> % ./ld/ld-new -o mm -Ttext 0 -e bios_f000 mm.o
> mm.o: In function `bios_f000':
> : relocation truncated to fit: R_386_PC16 against symbol `bios_f000' 
> defined in .text section in mm.o
>
> This is because bfd now thinks the jump is out of range.

Which is correct, in the context of 32 bit ELF.

> I don't know how to teach bfd to make a difference between .code16 and 
> .code32 (or .code64 for that matter) in doing the overflow checking.

The linker only knows about the 32 bit ELF format.  There is no relocation
that can represent a pc-relative relocation that wraps around in 16 bits.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]