Don't depend on "call foo" producing a X86_64_PC32.

Newer versions of the gnu assembler produce a X86_64_PLT32 for
calls. There is a change under review in llvm to do the same, so update
the tests to not depend on it.

We can still produce a R_X86_64_PC32 with ".long foo - .".

llvm-svn: 325379
This commit is contained in:
Rafael Espindola
2018-02-16 20:05:58 +00:00
parent 10ae20d80c
commit f931c179ca
11 changed files with 54 additions and 32 deletions

View File

@@ -19,5 +19,7 @@
.global _start
_start:
call bar
call zed
.byte 0xe8
.long bar - .
.byte 0xe8
.long zed - .

View File

@@ -7,4 +7,4 @@
.global _start
_start:
call x
.long x - .

View File

@@ -7,8 +7,10 @@
.global _start
_start:
call bar
call foo
.byte 0xe8
.long bar - . -4
.byte 0xe8
.long foo - . -4
// CHECK: Name: .plt
// CHECK-NEXT: Type: SHT_PROGBITS

View File

@@ -125,7 +125,7 @@
.section .text.foo, "ax"
.globl foo
foo:
call bar
.long bar - .
.section .text.bar, "ax"
.globl bar
@@ -136,9 +136,9 @@ ret
.globl _start
.weak qux
_start:
call baz
call qux
.long baz - .
.long qux - .
ret
.section .text.unused, "ax"
call bar2
.long bar2 - .

View File

@@ -17,9 +17,12 @@
_start:
.quad sharedFoo
.quad sharedBar
callq sharedFunc1
callq sharedFunc2
call baz
.byte 0xe8
.long sharedFunc1 - .
.byte 0xe8
.long sharedFunc2 - .
.byte 0xe8
.long baz - .
.global _Z1fi
_Z1fi:
.cfi_startproc

View File

@@ -15,5 +15,7 @@ _start:
nop
.section .nonalloc
call _start
call _start
.byte 0xe8
.long _start - . - 4
.byte 0xe8
.long _start - . - 4

View File

@@ -174,21 +174,33 @@
.global _start
.text
_start:
call __start_foo
call __stop_foo
.byte 0xe8
.long __start_foo - . -4
.byte 0xe8
.long __stop_foo - . -4
call __start_bar
call __stop_bar
.byte 0xe8
.long __start_bar - . -4
.byte 0xe8
.long __stop_bar - . -4
call __start_doo
call __stop_doo
.byte 0xe8
.long __start_doo - . -4
.byte 0xe8
.long __stop_doo - . -4
call __preinit_array_start
call __preinit_array_end
call __init_array_start
call __init_array_end
call __fini_array_start
call __fini_array_end
.byte 0xe8
.long __preinit_array_start - . -4
.byte 0xe8
.long __preinit_array_end - . -4
.byte 0xe8
.long __init_array_start - . -4
.byte 0xe8
.long __init_array_end - . -4
.byte 0xe8
.long __fini_array_start - . -4
.byte 0xe8
.long __fini_array_end - . -4
.section foo,"ax"
nop

View File

@@ -196,6 +196,6 @@
.globl _start
_start:
callq a
callq b
callq c
.long a - .
.long b - .
.long c - .

View File

@@ -11,4 +11,4 @@
.section .bar,"awx"
.global _start
_start:
call foo
.long foo - .

View File

@@ -7,4 +7,5 @@
# CHECK: >>> referenced by {{.*}}:(.data+0x1)
.data
call _shared
.byte 0xe8
.long _shared - .

View File

@@ -8,4 +8,4 @@
.global _start
_start:
callq foo
.long foo - .