This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
.type SYM,number pseudo-op used on solaris
- To: binutils@sourceware.cygnus.com
- Subject: .type SYM,number pseudo-op used on solaris
- From: Assar Westerlund <assar@sics.se>
- Date: 14 May 1999 04:25:54 +0200
Hi.
When trying to assemble fiels generated from Sun's CC on Solaris 2.7
of the following version:
cc: WorkShop Compilers 5.0 98/12/15 C 5.0
It generates lines of the form .type SYM,number instead of .type
SYM,#function (in this case). I don't understand or know the reason
for this behaviour but fixing gas to cope with it was easy enough.
Patches are appended.
/assar
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/obj-elf.c,v
retrieving revision 1.1.1.1
diff -u -w -u -w -r1.1.1.1 obj-elf.c
--- obj-elf.c 1999/05/03 07:28:41 1.1.1.1
+++ obj-elf.c 1999/05/14 02:18:00
@@ -1242,6 +1242,8 @@
.type SYM STT_FUNC
The fourth (used on NetBSD/Arm and Linux/ARM) is
.type SYM,%function
+ The fifth (used somtimes on Solaris) is
+ .type SYM,number
*/
static void
@@ -1269,6 +1271,28 @@
|| *input_line_pointer == '%')
++input_line_pointer;
+ if (isdigit (*input_line_pointer))
+ {
+ int tmp = get_absolute_expression ();
+
+ switch (tmp)
+ {
+ case 0:
+ type = BSF_NO_FLAGS;
+ break;
+ case 1:
+ type = BSF_OBJECT;
+ break;
+ case 2:
+ type = BSF_FUNCTION;
+ break;
+ default :
+ as_bad (_("ignoring unrecognized symbol type \"%d\""), tmp);
+ break;
+ }
+ }
+ else
+ {
typename = input_line_pointer;
c = get_symbol_end ();
@@ -1279,10 +1303,14 @@
else if (strcmp (typename, "object") == 0
|| strcmp (typename, "STT_OBJECT") == 0)
type = BSF_OBJECT;
+ else if (strcmp (typename, "no_type") == 0
+ || strcmp (typename, "STT_NO_TYPE") == 0)
+ type = BSF_NO_FLAGS;
else
as_bad (_("ignoring unrecognized symbol type \"%s\""), typename);
*input_line_pointer = c;
+ }
sym->bsym->flags |= type;