bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/19567] Symbol_value::value doesn't support x32 overflow check


From: hjl.tools at gmail dot com
Subject: [Bug gold/19567] Symbol_value::value doesn't support x32 overflow check
Date: Fri, 05 Feb 2016 18:50:13 +0000

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:
> > 
> > address@hidden pr19567]$ cat x.s
> >     .globl _start
> > _start:
> >     mov $_start,%rax
> >     mov _start,%rax
> > address@hidden 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]