[Patch mach-o, indirect symbols 2/2] tests for dysymtab

Iain Sandoe developer@sandoe-acoustics.co.uk
Fri Dec 30 15:46:00 GMT 2011
hello ...
This supports the first patch in this pair by providing such tests as  
can be done without GAS support for mach-o indirects.

This is mach-o local, but I don't know if the policy here is like on  
GCC - where port-owners also generally approve port-specific test- 
suite additions - or do I need also to notify a general maintainer?

anyway, the patch is pretty mechanical ...
OK?
Iain

gas/testsuite

	* gas/mach-o/dysymtab-1-64.d: New.
	* gas/mach-o/dysymtab-1.d: New.
	* gas/mach-o/symbols-1-64.d: New.
	* gas/mach-o/symbols-1.d: New.
	* gas/mach-o/symbols-base-64.s: New.
	* gas/mach-o/symbols-base.s: New.

  gas/testsuite/gas/mach-o/dysymtab-1-64.d   |   15 ++++
  gas/testsuite/gas/mach-o/dysymtab-1.d      |   15 ++++
  gas/testsuite/gas/mach-o/symbols-1-64.d    |   70 ++++++++++++++++++++
  gas/testsuite/gas/mach-o/symbols-1.d       |   70 ++++++++++++++++++++
  gas/testsuite/gas/mach-o/symbols-base-64.s |   97 +++++++++++++++++++ 
+++++++++
  gas/testsuite/gas/mach-o/symbols-base.s    |   97 +++++++++++++++++++ 
+++++++++
  6 files changed, 364 insertions(+), 0 deletions(-)

diff --git a/gas/testsuite/gas/mach-o/dysymtab-1-64.d b/gas/testsuite/ 
gas/mach-o/dysymtab-1-64.d
new file mode 100644
index 0000000..2b2b419
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/dysymtab-1-64.d
@@ -0,0 +1,15 @@
+#objdump: -P dysymtab
+#target: x86_64-*-darwin* powerpc64-*-darwin*
+#source: symbols-base-64.s
+.*: +file format mach-o.*
+#...
+Load command dysymtab:
+              local symbols: idx:          0  num: 6.*\(nxtidx: 6\)
+           external symbols: idx:          6  num: 18.*\(nxtidx: 24\)
+          undefined symbols: idx:         24  num: 21.*\(nxtidx: 45\)
+           table of content: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+               module table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+   external reference table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+      indirect symbol table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+  external relocation table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+     local relocation table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
diff --git a/gas/testsuite/gas/mach-o/dysymtab-1.d b/gas/testsuite/gas/ 
mach-o/dysymtab-1.d
new file mode 100644
index 0000000..48db498
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/dysymtab-1.d
@@ -0,0 +1,15 @@
+#objdump: -P dysymtab
+#target: i?86-*-darwin* powerpc-*-darwin*
+#source: symbols-base.s
+.*: +file format mach-o.*
+#...
+Load command dysymtab:
+              local symbols: idx:          0  num: 6.*\(nxtidx: 6\)
+           external symbols: idx:          6  num: 18.*\(nxtidx: 24\)
+          undefined symbols: idx:         24  num: 21.*\(nxtidx: 45\)
+           table of content: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+               module table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+   external reference table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+      indirect symbol table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+  external relocation table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
+     local relocation table: off: 0x00000000  num: 0.*\(endoff:  
0x00000000\)
diff --git a/gas/testsuite/gas/mach-o/symbols-1-64.d b/gas/testsuite/ 
gas/mach-o/symbols-1-64.d
new file mode 100644
index 0000000..9d23ee1
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/symbols-1-64.d
@@ -0,0 +1,70 @@
+#as: -L
+#objdump: -t
+#target: x86_64-*-darwin* powerpc64-*-darwin*
+#source: symbols-base-64.s
+.*: +file format mach-o.*
+#...
+SYMBOL TABLE:
+0000000000000000 l.*0e SECT   01 0000 \[.text\] Lzt0
+0000000000000002 l.*0e SECT   01 0000 \[.text\] Lmt0
+0000000000000004 l.*0e SECT   01 0000 \[.text\] Lat0
+0000000000000000 l.*0e SECT   02 0000 \[.data\] Lzd0
+0000000000000002 l.*0e SECT   02 0000 \[.data\] Lmd0
+0000000000000005 l.*0e SECT   02 0000 \[.data\] Lad0
+0000000000000000 l.*0e SECT   03 0000 \[.bss\] zlcomm0
+0000000000000006 l.*0e SECT   03 0000 \[.bss\] mlcomm0
+000000000000000c l.*0e SECT   03 0000 \[.bss\] alcomm0
+0000000000000000 l.*0e SECT   04 0000 \[__HERE.__there\] Lzs0
+0000000000000002 l.*0e SECT   04 0000 \[__HERE.__there\] Lms0
+0000000000000004 l.*0e SECT   04 0000 \[__HERE.__there\] Las0
+000000000000001e l.*0e SECT   01 0000 \[.text\] Lzt1
+0000000000000021 l.*0e SECT   01 0000 \[.text\] Lmt1
+0000000000000023 l.*0e SECT   01 0000 \[.text\] Lat1
+000000000000001e l.*0e SECT   02 0000 \[.data\] Lzd1
+0000000000000020 l.*0e SECT   02 0000 \[.data\] Lmd1
+0000000000000023 l.*0e SECT   02 0000 \[.data\] Lad1
+0000000000000012 l.*0e SECT   03 0000 \[.bss\] zlcomm1
+0000000000000018 l.*0e SECT   03 0000 \[.bss\] mlcomm1
+000000000000001e l.*0e SECT   03 0000 \[.bss\] alcomm1
+0000000000000026 l.*0e SECT   04 0000 \[__HERE.__there\] Lzs1
+0000000000000032 l.*0e SECT   04 0000 \[__HERE.__there\] Lms1
+0000000000000033 l.*0e SECT   04 0000 \[__HERE.__there\] Las1
+0000000000000004 g.*0f SECT   02 0000 \[.data\] adg0
+0000000000000022 g.*0f SECT   02 0000 \[.data\] adg1
+0000000000000005 g.*0f SECT   04 0000 \[__HERE.__there\] asg0
+0000000000000031 g.*0f SECT   04 0000 \[__HERE.__there\] asg1
+0000000000000005 g.*0f SECT   01 0000 \[.text\] atg0
+0000000000000022 g.*0f SECT   01 0000 \[.text\] atg1
+0000000000000003 g.*0f SECT   02 0000 \[.data\] mdg0
+0000000000000021 g.*0f SECT   02 0000 \[.data\] mdg1
+0000000000000003 g.*0f SECT   04 0000 \[__HERE.__there\] msg0
+0000000000000030 g.*0f SECT   04 0000 \[__HERE.__there\] msg1
+0000000000000003 g.*0f SECT   01 0000 \[.text\] mtg0
+0000000000000020 g.*0f SECT   01 0000 \[.text\] mtg1
+0000000000000001 g.*0f SECT   02 0000 \[.data\] zdg0
+000000000000001f g.*0f SECT   02 0000 \[.data\] zdg1
+0000000000000001 g.*0f SECT   04 0000 \[__HERE.__there\] zsg0
+0000000000000027 g.*0f SECT   04 0000 \[__HERE.__there\] zsg1
+0000000000000001 g.*0f SECT   01 0000 \[.text\] ztg0
+000000000000001f g.*0f SECT   01 0000 \[.text\] ztg1
+0000000000000000 g.*01 UND    00 0000 _aud0
+0000000000000000 g.*01 UND    00 0000 _aud1
+0000000000000000 g.*01 UND    00 0000 _aus0
+0000000000000000 g.*01 UND    00 0000 _aus1
+0000000000000000 g.*01 UND    00 0000 _aut0
+0000000000000000 g.*01 UND    00 0000 _mud0
+0000000000000000 g.*01 UND    00 0000 _mud1
+0000000000000000 g.*01 UND    00 0000 _mus0
+0000000000000000 g.*01 UND    00 0000 _mus1
+0000000000000000 g.*01 UND    00 0000 _mut0
+0000000000000000 g.*01 UND    00 0000 _zud0
+0000000000000000 g.*01 UND    00 0000 _zud1
+0000000000000000 g.*01 UND    00 0000 _zus0
+0000000000000000 g.*01 UND    00 0000 _zus1
+0000000000000000 g.*01 UND    00 0000 _zut0
+000000000000000a.*01 COM    00 0300 acommon0
+000000000000000a.*01 COM    00 0300 acommon1
+000000000000000a.*01 COM    00 0300 mcommon0
+000000000000000a.*01 COM    00 0300 mcommon1
+000000000000000a.*01 COM    00 0300 zcommon0
+000000000000000a.*01 COM    00 0300 zcommon1
\ No newline at end of file
diff --git a/gas/testsuite/gas/mach-o/symbols-1.d b/gas/testsuite/gas/ 
mach-o/symbols-1.d
new file mode 100644
index 0000000..cfc1dca
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/symbols-1.d
@@ -0,0 +1,70 @@
+#as: -L
+#objdump: -t
+#target: i?86-*-darwin* powerpc-*-darwin*
+#source: symbols-base.s
+.*: +file format mach-o.*
+#...
+SYMBOL TABLE:
+00000000 l.*0e SECT   01 0000 \[.text\] Lzt0
+00000002 l.*0e SECT   01 0000 \[.text\] Lmt0
+00000004 l.*0e SECT   01 0000 \[.text\] Lat0
+00000000 l.*0e SECT   02 0000 \[.data\] Lzd0
+00000002 l.*0e SECT   02 0000 \[.data\] Lmd0
+00000005 l.*0e SECT   02 0000 \[.data\] Lad0
+00000000 l.*0e SECT   03 0000 \[.bss\] zlcomm0
+00000006 l.*0e SECT   03 0000 \[.bss\] mlcomm0
+0000000c l.*0e SECT   03 0000 \[.bss\] alcomm0
+00000000 l.*0e SECT   04 0000 \[__HERE.__there\] Lzs0
+00000002 l.*0e SECT   04 0000 \[__HERE.__there\] Lms0
+00000004 l.*0e SECT   04 0000 \[__HERE.__there\] Las0
+00000012 l.*0e SECT   01 0000 \[.text\] Lzt1
+00000015 l.*0e SECT   01 0000 \[.text\] Lmt1
+00000017 l.*0e SECT   01 0000 \[.text\] Lat1
+00000012 l.*0e SECT   02 0000 \[.data\] Lzd1
+00000014 l.*0e SECT   02 0000 \[.data\] Lmd1
+00000017 l.*0e SECT   02 0000 \[.data\] Lad1
+00000012 l.*0e SECT   03 0000 \[.bss\] zlcomm1
+00000018 l.*0e SECT   03 0000 \[.bss\] mlcomm1
+0000001e l.*0e SECT   03 0000 \[.bss\] alcomm1
+00000016 l.*0e SECT   04 0000 \[__HERE.__there\] Lzs1
+0000001e l.*0e SECT   04 0000 \[__HERE.__there\] Lms1
+0000001f l.*0e SECT   04 0000 \[__HERE.__there\] Las1
+00000004 g.*0f SECT   02 0000 \[.data\] adg0
+00000016 g.*0f SECT   02 0000 \[.data\] adg1
+00000005 g.*0f SECT   04 0000 \[__HERE.__there\] asg0
+0000001d g.*0f SECT   04 0000 \[__HERE.__there\] asg1
+00000005 g.*0f SECT   01 0000 \[.text\] atg0
+00000016 g.*0f SECT   01 0000 \[.text\] atg1
+00000003 g.*0f SECT   02 0000 \[.data\] mdg0
+00000015 g.*0f SECT   02 0000 \[.data\] mdg1
+00000003 g.*0f SECT   04 0000 \[__HERE.__there\] msg0
+0000001c g.*0f SECT   04 0000 \[__HERE.__there\] msg1
+00000003 g.*0f SECT   01 0000 \[.text\] mtg0
+00000014 g.*0f SECT   01 0000 \[.text\] mtg1
+00000001 g.*0f SECT   02 0000 \[.data\] zdg0
+00000013 g.*0f SECT   02 0000 \[.data\] zdg1
+00000001 g.*0f SECT   04 0000 \[__HERE.__there\] zsg0
+00000017 g.*0f SECT   04 0000 \[__HERE.__there\] zsg1
+00000001 g.*0f SECT   01 0000 \[.text\] ztg0
+00000013 g.*0f SECT   01 0000 \[.text\] ztg1
+00000000 g.*01 UND    00 0000 _aud0
+00000000 g.*01 UND    00 0000 _aud1
+00000000 g.*01 UND    00 0000 _aus0
+00000000 g.*01 UND    00 0000 _aus1
+00000000 g.*01 UND    00 0000 _aut0
+00000000 g.*01 UND    00 0000 _mud0
+00000000 g.*01 UND    00 0000 _mud1
+00000000 g.*01 UND    00 0000 _mus0
+00000000 g.*01 UND    00 0000 _mus1
+00000000 g.*01 UND    00 0000 _mut0
+00000000 g.*01 UND    00 0000 _zud0
+00000000 g.*01 UND    00 0000 _zud1
+00000000 g.*01 UND    00 0000 _zus0
+00000000 g.*01 UND    00 0000 _zus1
+00000000 g.*01 UND    00 0000 _zut0
+0000000a.*01 COM    00 0300 acommon0
+0000000a.*01 COM    00 0300 acommon1
+0000000a.*01 COM    00 0300 mcommon0
+0000000a.*01 COM    00 0300 mcommon1
+0000000a.*01 COM    00 0300 zcommon0
+0000000a.*01 COM    00 0300 zcommon1
\ No newline at end of file
diff --git a/gas/testsuite/gas/mach-o/symbols-base-64.s b/gas/ 
testsuite/gas/mach-o/symbols-base-64.s
new file mode 100644
index 0000000..604501c
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/symbols-base-64.s
@@ -0,0 +1,97 @@
+# baseline symbols in sections.
+Lzt0:	.space 1
+	.globl ztg0
+ztg0:	.space 1
+Lmt0:	.space 1
+	.globl mtg0
+mtg0:	.space 1
+Lat0:	.space 1
+	.globl atg0
+atg0:	.space 1
+
+	.quad	_zut0
+	.quad	_mut0
+	.quad	_aut0
+
+	.comm zcommon0, 10, 3
+	.comm mcommon0, 10, 3
+	.comm acommon0, 10, 3
+
+	.data
+Lzd0:	.space 1
+	.globl zdg0
+zdg0:	.space 1
+Lmd0:	.space 1
+	.globl mdg0
+mdg0:	.space 1
+adg0:	.space 1
+	.globl adg0
+Lad0:	.space 1
+
+	.quad	_zud0
+	.quad	_mud0
+	.quad	_aud0
+
+	.lcomm zlcomm0, 5, 1
+	.lcomm mlcomm0, 5, 1
+	.lcomm alcomm0, 5, 1
+
+	.section __HERE,__there
+Lzs0:	.space 1
+	.globl zsg0
+zsg0:	.space 1
+Lms0:	.space 1
+	.globl msg0
+msg0:	.space 1
+Las0:	.space 1
+asg0:	.space 1
+	.globl asg0
+
+	.quad	_zus0
+	.quad	_mus0
+	.quad	_aus0
+
+	.text
+Lzt1:	.space 1
+	.globl ztg1
+ztg1:	.space 1
+	.globl mtg1
+mtg1:	.space 1
+Lmt1:	.space 1
+atg1:	.space 1
+	.globl atg1
+Lat1:	.space 1
+
+	.comm zcommon1, 10, 3
+	.comm mcommon1, 10, 3
+	.comm acommon1, 10, 3
+
+	.data
+Lzd1:	.space 1
+	.globl zdg1, mdg1, adg1
+zdg1:	.space 1
+Lmd1:	.space 1
+mdg1:	.space 1
+adg1:	.space 1
+Lad1:	.space 1
+
+	.quad	_zud1
+	.quad	_mud1
+	.quad	_aud1
+
+	.lcomm zlcomm1, 5, 1
+	.lcomm mlcomm1, 5, 1
+	.lcomm alcomm1, 5, 1
+
+	.section __HERE,__there
+	.quad	_zus1
+Lzs1:	.space 1
+zsg1:	.space 1
+	.quad	_mus1
+msg1:	.space 1
+asg1:	.space 1
+	.globl zsg1, msg1, asg1
+Lms1:	.space 1
+Las1:	.space 1
+
+	.quad	_aus1
diff --git a/gas/testsuite/gas/mach-o/symbols-base.s b/gas/testsuite/ 
gas/mach-o/symbols-base.s
new file mode 100644
index 0000000..a7b8e75
--- /dev/null
+++ b/gas/testsuite/gas/mach-o/symbols-base.s
@@ -0,0 +1,97 @@
+# baseline symbols in sections.
+Lzt0:	.space 1
+	.globl ztg0
+ztg0:	.space 1
+Lmt0:	.space 1
+	.globl mtg0
+mtg0:	.space 1
+Lat0:	.space 1
+	.globl atg0
+atg0:	.space 1
+
+	.long	_zut0
+	.long	_mut0
+	.long	_aut0
+
+	.comm zcommon0, 10, 3
+	.comm mcommon0, 10, 3
+	.comm acommon0, 10, 3
+
+	.data
+Lzd0:	.space 1
+	.globl zdg0
+zdg0:	.space 1
+Lmd0:	.space 1
+	.globl mdg0
+mdg0:	.space 1
+adg0:	.space 1
+	.globl adg0
+Lad0:	.space 1
+
+	.long	_zud0
+	.long	_mud0
+	.long	_aud0
+
+	.lcomm zlcomm0, 5, 1
+	.lcomm mlcomm0, 5, 1
+	.lcomm alcomm0, 5, 1
+
+	.section __HERE,__there
+Lzs0:	.space 1
+	.globl zsg0
+zsg0:	.space 1
+Lms0:	.space 1
+	.globl msg0
+msg0:	.space 1
+Las0:	.space 1
+asg0:	.space 1
+	.globl asg0
+
+	.long	_zus0
+	.long	_mus0
+	.long	_aus0
+
+	.text
+Lzt1:	.space 1
+	.globl ztg1
+ztg1:	.space 1
+	.globl mtg1
+mtg1:	.space 1
+Lmt1:	.space 1
+atg1:	.space 1
+	.globl atg1
+Lat1:	.space 1
+
+	.comm zcommon1, 10, 3
+	.comm mcommon1, 10, 3
+	.comm acommon1, 10, 3
+
+	.data
+Lzd1:	.space 1
+	.globl zdg1, mdg1, adg1
+zdg1:	.space 1
+Lmd1:	.space 1
+mdg1:	.space 1
+adg1:	.space 1
+Lad1:	.space 1
+
+	.long	_zud1
+	.long	_mud1
+	.long	_aud1
+
+	.lcomm zlcomm1, 5, 1
+	.lcomm mlcomm1, 5, 1
+	.lcomm alcomm1, 5, 1
+
+	.section __HERE,__there
+	.long	_zus1
+Lzs1:	.space 1
+zsg1:	.space 1
+	.long	_mus1
+msg1:	.space 1
+asg1:	.space 1
+	.globl zsg1, msg1, asg1
+Lms1:	.space 1
+Las1:	.space 1
+
+	.long	_aus1



More information about the Binutils mailing list