I discovered the second example when trying to correct for the first.
This small program:
.intel_syntax noprefix
.altmacro
.text
.global testa
.macro zzz a
add rax,OFFSET \a+8
sub rax,OFFSET \a+8
.endm
.macro yyy a
local q
.equ q, (\a+8)
lea rax,[rax+(\a+8)]
lea rax,[rax-q]
.endm
.data
.align 16,0
.equ d, .
.byte 0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0
.equ c, .-d
.equ b, 14
.text
.align 16,0
testa: push rbp
mov rbp,rsp
add rax,OFFSET b+c+8
zzz b+c
lea rax,[rax-3]
yyy b+c
leave
ret
.end
generates different code on 2.16 than on 2.15.
In 2.15:
32 0004 48052400 add rax,OFFSET b+c+8
32 0000
In 2.16:
32 0004 48030425 add rax,OFFSET b+c+8
32 24000000
The 2.16 object code causes a segfault.
in 2.15:
37 001a 488D8024 > lea rax,[rax+(b+c+8)]
37 000000
37 0021 488D80DC > lea rax,[rax-.LL0001]
37 FFFFFF
in 2.16:
37 yyy b+c
37 >
37 > .equ .LL0001,(b+c+8)
37 0020 488D4016 > lea rax,[rax+(b+c+8)]
37 0024 488D80EA > lea rax,[rax-.LL0001]
37 FFFFFF
--
Summary: generated code mismatches between 2.15 and 2.16
Product: binutils
Version: 2.16
Status: NEW
Severity: normal
Priority: P2
Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: michaelryan at mindspring dot com
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=3159
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils