[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/18386] callw with 0x66 prefix incorrectly disassembled in
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug binutils/18386] callw with 0x66 prefix incorrectly disassembled in 64-bit mode |
Date: |
Thu, 02 Jun 2016 17:23:29 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18386
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
0x66 prefix should also be ignored in 64-bit mode:
address@hidden 18386b]$ cat call.S
.text
.p2align 4,,15
.globl bar
.type bar, @function
bar:
data16 jmp *foo_p(%rip)
.size bar, .-bar
address@hidden 18386b]$ cat main.c
#include <stdio.h>
const char* (*foo_p) (void);
const char* bar (void);
const char*
foo (void)
{
return "PASS";
}
int
main (int argc, char **argv)
{
foo_p = foo;
printf("%s\n", bar ());
printf("%p\n", foo);
return 0;
}
address@hidden 18386b]$ make
gcc -pie -B./ -fPIE -c -o main.o main.c
gcc -pie -B./ -c -o call.o call.S
gcc -pie -B./ -o x main.o call.o
./x
PASS
0x56102545b6c0
address@hidden 18386b]$ objdump -dwr call.o
call.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <bar>:
0: 66 ff 25 00 00 00 00 jmpw *0x0(%rip) # 7 <bar+0x7> 3:
R_X86_64_PC32 foo_p-0x4
address@hidden 18386b]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/18386] callw with 0x66 prefix incorrectly disassembled in 64-bit mode,
hjl.tools at gmail dot com <=