xref: /illumos-gate/usr/src/test/elf-tests/tests/tls/amd64/ld/ld-with-addend.s (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
1/*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source.  A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12/*
13 * Copyright 2012, Richard Lowe.
14 */
15
16	.section	.rodata.str1.1,"aMS",@progbits,1
17.LC0:
18	.string	"foo: %s (%p)\n"
19	.text
20	.section	.tdata,"awT",@progbits
21foo:
22	.string	"incorrect"
23        .text
24.globl main
25	.type	main, @function
26main:
27.LFB0:
28	pushq	%rbp
29.LCFI0:
30	movq	%rsp, %rbp
31        .LCFI1:
32	leaq	foo@tlsld(%rip), %rdi
33	call	__tls_get_addr@plt
34	leaq	2+foo@dtpoff(%rax), %rsi
35        movq	%rsi, %rdx
36        movq	%rsi, %rsi
37	movl	$.LC0, %edi
38	movl	$0, %eax
39	call	printf
40	movl	$0, %eax
41	leave
42	ret
43	.size	main, .-main
44