DescriptionForward-port nacl assembler hacks
Most changes are not really needed because they can be replaced
with .bundle_lock/.bundle_unlock directives, but call handling can
not be emulated.
Simple test to verify changes:
$ cat test.s
calltest:
call calltarget1
call calltarget2
call calltarget3
call externtarget
.p2align 5
regular_instruction:
.fill 30,1,0x90
calltarget1:
mov %rax,%rax
.p2align 5
nacl_instruction:
.fill 27,1,0x90
calltarget2:
mov %nacl:(%r15,%rax),%rax
.p2align 5
bundle_instruction:
.fill 27,1,0x90
calltarget3:
.bundle_lock
lea (%rax),%eax
mov (%r15,%rax),%rax
.bundle_unlock
$ x86_64-nacl-as --64 test.s -o test.o
$ objdump -dr test.o
test.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <calltest>:
...
1b: e8 7e 00 00 00 callq 9e <calltarget1>
...
3b: e8 9b 00 00 00 callq db <calltarget2>
...
5b: e8 bb 00 00 00 callq 11b <calltarget3>
...
7b: e8 00 00 00 00 callq 80 <regular_instruction>
7c: R_X86_64_PC32 externtarget-0x4
0000000000000080 <regular_instruction>:
...
000000000000009e <calltarget1>:
9e: 66 90 xchg %ax,%ax
a0: 48 89 c0 mov %rax,%rax
...
00000000000000db <calltarget2>:
db: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
e0: 89 c0 mov %eax,%eax
e2: 49 8b 04 07 mov (%r15,%rax,1),%rax
...
000000000000011b <calltarget3>:
11b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
120: 8d 00 lea (%rax),%eax
122: 49 8b 04 07 mov (%r15,%rax,1),%rax
Note relocation's handling and how all the instructions are correctly
moved to the end of bundle (for calls) or to the next bundle (for other
instructions).
R=mcgrathr@chromium.org
Committed: https://git.chromium.org/gitweb?p=native_client/nacl-gcc.git;a=commit;h=48ea2e3
Patch Set 1 #Patch Set 2 : Removed Makefile.{am,in} changed (6 lines), added i386-tbl.h changes (3342 lines) #
MessagesTotal messages: 5
|