PATCH: Add notype

H. J. Lu hjl@lucon.org
Thu May 1 15:31:00 GMT 2003


Intel ia64 assembler accepts ".type   notype,@notype". This patch
implements it. BTW, I can make it ia64 specific if needed.


H.J.
-------------- next part --------------
2003-04-28  H.J. Lu <hjl@gnu.org>

	* config/obj-elf.c (obj_elf_type): Accept "notype" and
	"STT_NOTYPE".

--- gas/config/obj-elf.c.notype	2003-04-28 13:48:54.000000000 -0700
+++ gas/config/obj-elf.c	2003-04-28 16:35:15.000000000 -0700
@@ -1644,6 +1644,9 @@ obj_elf_type (ignore)
   else if (strcmp (typename, "tls_object") == 0
 	   || strcmp (typename, "STT_TLS") == 0)
     type = BSF_OBJECT | BSF_THREAD_LOCAL;
+  else if (strcmp (typename, "notype") == 0
+	   || strcmp (typename, "STT_NOTYPE") == 0)
+    ;
 #ifdef md_elf_symbol_type
   else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1)
     ;
-------------- next part --------------
2003-04-29  H.J. Lu <hjl@gnu.org>

	* gas/elf/elf.exp (run_list_test): Accept empty $opts.
	Add type test.

	* gas/elf/type.e: New file.
	* gas/elf/type.s: Likewise.

--- gas/testsuite/gas/elf/elf.exp.type	2003-04-29 08:51:26.000000000 -0700
+++ gas/testsuite/gas/elf/elf.exp	2003-04-29 11:08:10.000000000 -0700
@@ -8,7 +8,8 @@ proc run_list_test { name suffix opts } 
     set testname "elf $name list"
     set file $srcdir/$subdir/$name
     gas_run ${name}.s "$opts -o dump.o" ">&dump.out"
-    if { [regexp_diff "dump.out" "${file}.l"] } then {
+    if { ![string match "" $opts]
+	  && [regexp_diff "dump.out" "${file}.l"] } then {
 	fail $testname
 	verbose "output is [file_contents "dump.out"]" 2
 	return
@@ -54,4 +55,5 @@ if { ([istarget "*-*-elf*"]		
     run_dump_test "section1" 
     run_list_test "section2" "$target_machine" "-al"
     run_dump_test "symver" 
+    run_list_test "type" "$target_machine" ""
 }
--- gas/testsuite/gas/elf/type.e.type	2003-04-29 11:10:30.000000000 -0700
+++ gas/testsuite/gas/elf/type.e	2003-04-29 11:09:38.000000000 -0700
@@ -0,0 +1,11 @@
+
+Symbol table '.symtab' contains 8 entries:
+   Num:    Value[ 	]* Size Type    Bind   Vis      Ndx Name
+     0: 0+0     0 NOTYPE  LOCAL  DEFAULT  UND 
+     1: 0+0     0 SECTION LOCAL  DEFAULT    1 
+     2: 0+0     0 SECTION LOCAL  DEFAULT    2 
+     3: 0+0     0 SECTION LOCAL  DEFAULT    3 
+     4: 0+0     1 FUNC    LOCAL  DEFAULT    . function
+     5: 0+0     1 OBJECT  LOCAL  DEFAULT    . object
+     6: 0+1     1 TLS     LOCAL  DEFAULT    . tls_object
+     7: 0+2     1 NOTYPE  LOCAL  DEFAULT    . notype
--- gas/testsuite/gas/elf/type.s.type	2003-04-29 11:10:34.000000000 -0700
+++ gas/testsuite/gas/elf/type.s	2003-04-29 11:06:28.000000000 -0700
@@ -0,0 +1,18 @@
+	.text
+        .size   function,1
+        .type   function,@function
+function:
+	.byte	0x0
+        .data
+        .type   object,@object
+        .size   object,1
+object:
+	.byte	0x0
+        .type   tls_object,@tls_object
+        .size   tls_object,1
+tls_object:
+	.byte	0x0
+        .type   notype,@notype
+        .size   notype,1
+notype:
+	.byte	0x0


More information about the Binutils mailing list