This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: COMMITTED: Add support for STT_IFUNC


Hi H.J.

Why aren't there x86-64 tests?

I have now checked in this patch to add an x86-64 test.


Cheers
  Nick

ld/testsuite/ChangeLog
2008-12-04  Nick Clifton  <nickc@redhat.com>

	* ld-x86-64/ifunc.d: New test (of STT_IFUNC for x86_64).
	* ld-x86-64/ifunc.s: Source file for new test.
	* ld-x86-64/x86-64.exp: Run the new test.
	* ld-i386/ifunc.d: Tidy up regexps for expected output.
Index: ld/testsuite/ld-i386/ifunc.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-i386/ifunc.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ifunc.d
*** ld/testsuite/ld-i386/ifunc.d	3 Dec 2008 14:51:00 -0000	1.1
--- ld/testsuite/ld-i386/ifunc.d	4 Dec 2008 10:58:03 -0000
***************
*** 1,14 ****
! #name: Generatiion of dynamic relocs for STT_IFUNC symbols
  #source: ifunc.s
  #as: --32
  #ld: -melf_i386 -lc --defsym _start=0 -L/usr/lib
  #readelf: --relocs --syms
  
  Relocation section '.rel.ifunc.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
!  Offset     Info    Type            Sym.Value  Sym. Name
! [0-9a-f]+  00000202 R_386_PC32        func\(\)     func
! [0-9a-f]+  00000102 R_386_PC32        long_fun\(\) long_func_name
  #...
!     ..: 080482e0    29 IFUNC   GLOBAL DEFAULT   10 long_func_name
!     ..: 08048300    29 IFUNC   GLOBAL DEFAULT   10 func
  #pass
--- 1,14 ----
! #name: Generation of dynamic relocs for STT_IFUNC symbols
  #source: ifunc.s
  #as: --32
  #ld: -melf_i386 -lc --defsym _start=0 -L/usr/lib
  #readelf: --relocs --syms
  
  Relocation section '.rel.ifunc.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
!  +Offset +Info +Type +Sym.Value +Sym. Name
! [0-9a-f]+  0+0202 R_386_PC32        func\(\)     func
! [0-9a-f]+  0+0102 R_386_PC32        long_fun\(\) long_func_name
  #...
!     ..: [0-9a-f]+    .. IFUNC   GLOBAL DEFAULT   .. long_func_name
!     ..: [0-9a-f]+    .. IFUNC   GLOBAL DEFAULT   .. func
  #pass
Index: ld/testsuite/ld-x86-64/ifunc.d
===================================================================
RCS file: ld/testsuite/ld-x86-64/ifunc.d
diff -N ld/testsuite/ld-x86-64/ifunc.d
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- ld/testsuite/ld-x86-64/ifunc.d	4 Dec 2008 10:58:03 -0000
***************
*** 0 ****
--- 1,14 ----
+ #name: Generation of dynamic relocs for STT_IFUNC symbols
+ #source: ifunc.s
+ #ld: --defsym _start=0 --defsym puts=0 --defsym rand=0 --defsym printf=0 
+ #readelf: --relocs --syms
+ 
+ Relocation section '.rela.ifunc.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+  +Offset +Info +Type  +Sym. Value +Sym. Name \+ Addend
+ [0-9a-f]+  0+20+2 R_X86_64_PC32     .*
+ [0-9a-f]+  0+10+2 R_X86_64_PC32     .*
+ #...
+     ..: [0-9a-f]+    .. IFUNC   GLOBAL DEFAULT   .. long_func_name
+ #...
+     ..: [0-9a-f]+    .. IFUNC   GLOBAL DEFAULT   .. func
+ #pass
Index: ld/testsuite/ld-x86-64/ifunc.s
===================================================================
RCS file: ld/testsuite/ld-x86-64/ifunc.s
diff -N ld/testsuite/ld-x86-64/ifunc.s
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- ld/testsuite/ld-x86-64/ifunc.s	4 Dec 2008 10:58:03 -0000
***************
*** 0 ****
--- 1,198 ----
+ 	.file	"ifunc.c"
+ #APP
+ 	.type func, %indirect_function
+ 	.type long_func_name, %indirect_function
+ 	.section	.rodata.str1.1,"aMS",@progbits,1
+ .LC0:
+ 	.string	"arg is %d\n"
+ #NO_APP
+ 	.text
+ 	.p2align 4,,15
+ .globl bar
+ 	.type	bar, @function
+ bar:
+ .LFB25:
+ 	movl	%edi, %esi
+ 	xorl	%eax, %eax
+ 	movl	$.LC0, %edi
+ 	jmp	printf
+ .LFE25:
+ 	.size	bar, .-bar
+ 	.section	.rodata.str1.1
+ .LC1:
+ 	.string	"main: calling func"
+ 	.section	.rodata.str1.8,"aMS",@progbits,1
+ 	.align 8
+ .LC2:
+ 	.string	"main: func finished, calling long_func_name"
+ 	.section	.rodata.str1.1
+ .LC3:
+ 	.string	"main: long_func_name finished"
+ 	.text
+ 	.p2align 4,,15
+ .globl main
+ 	.type	main, @function
+ main:
+ .LFB24:
+ 	subq	$8, %rsp
+ .LCFI0:
+ 	movl	$.LC1, %edi
+ 	call	puts
+ 	call	func
+ 	movl	$.LC2, %edi
+ 	call	puts
+ 	call	long_func_name
+ 	movl	$.LC3, %edi
+ 	call	puts
+ 	xorl	%eax, %eax
+ 	addq	$8, %rsp
+ 	ret
+ .LFE24:
+ 	.size	main, .-main
+ 	.p2align 4,,15
+ .globl long_func_name
+ 	.type	long_func_name, @function
+ long_func_name:
+ .LFB23:
+ 	subq	$8, %rsp
+ .LCFI1:
+ 	call	rand
+ 	movl	%eax, %edx
+ 	movl	$func1, %eax
+ 	testl	%edx, %edx
+ 	movl	$func0, %edx
+ 	cmovne	%rdx, %rax
+ 	addq	$8, %rsp
+ 	ret
+ .LFE23:
+ 	.size	long_func_name, .-long_func_name
+ 	.p2align 4,,15
+ .globl func
+ 	.type	func, @function
+ func:
+ .LFB22:
+ 	subq	$8, %rsp
+ .LCFI2:
+ 	call	rand
+ 	movl	%eax, %edx
+ 	movl	$func1, %eax
+ 	testl	%edx, %edx
+ 	movl	$func0, %edx
+ 	cmovne	%rdx, %rax
+ 	addq	$8, %rsp
+ 	ret
+ .LFE22:
+ 	.size	func, .-func
+ 	.section	.rodata.str1.1
+ .LC4:
+ 	.string	"func1\n"
+ 	.text
+ 	.p2align 4,,15
+ .globl func1
+ 	.type	func1, @function
+ func1:
+ .LFB21:
+ 	movl	$.LC4, %edi
+ 	jmp	puts
+ .LFE21:
+ 	.size	func1, .-func1
+ 	.section	.rodata.str1.1
+ .LC5:
+ 	.string	"func0\n"
+ 	.text
+ 	.p2align 4,,15
+ .globl func0
+ 	.type	func0, @function
+ func0:
+ .LFB20:
+ 	movl	$.LC5, %edi
+ 	jmp	puts
+ .LFE20:
+ 	.size	func0, .-func0
+ 	.section	.eh_frame,"a",@progbits
+ .Lframe1:
+ 	.long	.LECIE1-.LSCIE1
+ .LSCIE1:
+ 	.long	0x0
+ 	.byte	0x1
+ 	.string	"zR"
+ 	.uleb128 0x1
+ 	.sleb128 -8
+ 	.byte	0x10
+ 	.uleb128 0x1
+ 	.byte	0x3
+ 	.byte	0xc
+ 	.uleb128 0x7
+ 	.uleb128 0x8
+ 	.byte	0x90
+ 	.uleb128 0x1
+ 	.align 8
+ .LECIE1:
+ .LSFDE1:
+ 	.long	.LEFDE1-.LASFDE1
+ .LASFDE1:
+ 	.long	.LASFDE1-.Lframe1
+ 	.long	.LFB25
+ 	.long	.LFE25-.LFB25
+ 	.uleb128 0x0
+ 	.align 8
+ .LEFDE1:
+ .LSFDE3:
+ 	.long	.LEFDE3-.LASFDE3
+ .LASFDE3:
+ 	.long	.LASFDE3-.Lframe1
+ 	.long	.LFB24
+ 	.long	.LFE24-.LFB24
+ 	.uleb128 0x0
+ 	.byte	0x4
+ 	.long	.LCFI0-.LFB24
+ 	.byte	0xe
+ 	.uleb128 0x10
+ 	.align 8
+ .LEFDE3:
+ .LSFDE5:
+ 	.long	.LEFDE5-.LASFDE5
+ .LASFDE5:
+ 	.long	.LASFDE5-.Lframe1
+ 	.long	.LFB23
+ 	.long	.LFE23-.LFB23
+ 	.uleb128 0x0
+ 	.byte	0x4
+ 	.long	.LCFI1-.LFB23
+ 	.byte	0xe
+ 	.uleb128 0x10
+ 	.align 8
+ .LEFDE5:
+ .LSFDE7:
+ 	.long	.LEFDE7-.LASFDE7
+ .LASFDE7:
+ 	.long	.LASFDE7-.Lframe1
+ 	.long	.LFB22
+ 	.long	.LFE22-.LFB22
+ 	.uleb128 0x0
+ 	.byte	0x4
+ 	.long	.LCFI2-.LFB22
+ 	.byte	0xe
+ 	.uleb128 0x10
+ 	.align 8
+ .LEFDE7:
+ .LSFDE9:
+ 	.long	.LEFDE9-.LASFDE9
+ .LASFDE9:
+ 	.long	.LASFDE9-.Lframe1
+ 	.long	.LFB21
+ 	.long	.LFE21-.LFB21
+ 	.uleb128 0x0
+ 	.align 8
+ .LEFDE9:
+ .LSFDE11:
+ 	.long	.LEFDE11-.LASFDE11
+ .LASFDE11:
+ 	.long	.LASFDE11-.Lframe1
+ 	.long	.LFB20
+ 	.long	.LFE20-.LFB20
+ 	.uleb128 0x0
+ 	.align 8
+ .LEFDE11:
+ 	.ident	"GCC: (GNU) 4.3.0 20080428 (Red Hat 4.3.0-8)"
+ 	.section	.note.GNU-stack,"",@progbits
Index: ld/testsuite/ld-x86-64/x86-64.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-x86-64/x86-64.exp,v
retrieving revision 1.9
diff -c -3 -p -r1.9 x86-64.exp
*** ld/testsuite/ld-x86-64/x86-64.exp	16 Mar 2008 22:26:23 -0000	1.9
--- ld/testsuite/ld-x86-64/x86-64.exp	4 Dec 2008 10:58:03 -0000
*************** run_dump_test "hidden3"
*** 92,94 ****
--- 92,95 ----
  run_dump_test "protected1"
  run_dump_test "protected2"
  run_dump_test "protected3"
+ run_dump_test "ifunc"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]