From 5232cc675c59ac04df616c45158f15c3c166f5d8 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 15 Jul 2011 21:28:39 +0000 Subject: [PATCH] PR10370: Make sure we know how to relax push correctly on x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135303 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86AsmBackend.cpp | 3 +++ test/MC/ELF/relocation.s | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Target/X86/X86AsmBackend.cpp b/lib/Target/X86/X86AsmBackend.cpp index 4d7d96dcb36..9b556a55efd 100644 --- a/lib/Target/X86/X86AsmBackend.cpp +++ b/lib/Target/X86/X86AsmBackend.cpp @@ -194,6 +194,9 @@ static unsigned getRelaxedOpcodeArith(unsigned Op) { // PUSH case X86::PUSHi8: return X86::PUSHi32; + case X86::PUSHi16: return X86::PUSHi32; + case X86::PUSH64i8: return X86::PUSH64i32; + case X86::PUSH64i16: return X86::PUSH64i32; } } diff --git a/test/MC/ELF/relocation.s b/test/MC/ELF/relocation.s index 7db2248adfb..2760232a5a8 100644 --- a/test/MC/ELF/relocation.s +++ b/test/MC/ELF/relocation.s @@ -92,23 +92,23 @@ bar: // CHECK: # Relocation 0x0000000b // CHECK-NEXT: (('r_offset', 0x0000004e) // CHECK-NEXT: ('r_sym', 0x00000002) -// CHECK-NEXT: ('r_type', 0x0000000e) +// CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', 0x00000000) // CHECK: # Relocation 0x0000000c -// CHECK-NEXT: (('r_offset', 0x00000052) +// CHECK-NEXT: (('r_offset', 0x00000055) // CHECK-NEXT: ('r_sym', 0x00000006) // CHECK-NEXT: ('r_type', 0x00000002) // CHECK-NEXT: ('r_addend', 0xfffffffc) // CHECK: # Relocation 0x0000000d -// CHECK-NEXT: (('r_offset', 0x00000059) +// CHECK-NEXT: (('r_offset', 0x0000005c) // CHECK-NEXT: ('r_sym', 0x00000006) // CHECK-NEXT: ('r_type', 0x00000002) -// CHECK-NEXT: ('r_addend', 0x00000059) +// CHECK-NEXT: ('r_addend', 0x0000005c) // CHECK: # Relocation 0x0000000e -// CHECK-NEXT: (('r_offset', 0x00000060) +// CHECK-NEXT: (('r_offset', 0x00000063) // CHECK-NEXT: ('r_sym', 0x00000002) // CHECK-NEXT: ('r_type', 0x0000000b) // CHECK-NEXT: ('r_addend', 0x00000000) -- 2.34.1