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

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Cary Coutant from comment #9)
> > My test here doesn't follow any programming model and is independent of
> > x32 or x86-64:
> > 
> > [hjl@gnu-6 pr19567]$ cat x.s
> >     .globl _start
> > _start:
> >     mov $_start,%rax
> >     mov _start,%rax
> > [hjl@gnu-6 pr19567]$ make
> > as  -o x.o x.s
> > ld.gold -Ttext-segment 0x80000000 -o x x.o
> 
> With today's patches to add overflow checking, this now gives relocation
> overflow errors for x86_64:
> 
> $ ../../ld-new -Ttext-segment=0x80000000 x64.o
> x64.o(.text+0x3): error: relocation overflow
> x64.o(.text+0xb): error: relocation overflow

Thanks.

> I guess we'll have to agree to disagree about x32.
> 
> > > $ ../../ld-new -m elf32_x86_64 -Ttext-segment=0x80000000 z.o
> > > $ objdump -d a.out
> > > 
> > > a.out:     file format elf32-x86-64
> > > 
> > > 
> > > Disassembly of section .text:
> > > 
> > > 80000074 <_start>:
> > > 80000074: 48 b8 74 00 00 80 00    movabs $0x80000074,%rax
> > > 8000007b: 00 00 00 
> > > 8000007e: 48 a1 74 00 00 80 00    movabs 0x80000074,%rax
> > > 80000085: 00 00 00 
> > > 
> > > Here, 0x80000074 should have been sign-extended when we applied the
> > > relocations.
> > 
> > No, it shouldn't.
> 
> Are you going to change the psABI document?

No.  Small model is for compilers.  Assembly can do whatever it wants
within 32-bit address space.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to