This is the mail archive of the binutils@sources.redhat.com 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]

Patch to check missing version names


The current as accepts

.symver foo,foo2@
.symver foo,foo2@@

This patch reports an error in those cases.

BTW, I created a testsuite for .symver. It also checks

.symver foo,foo2@@@version

I will submit my testsuite patch after the

.symver foo,foo2@@@version

patch is checked in.

-- 
H.J. Lu (hjl@valinux.com)
---
2000-11-18  H.J. Lu  (hjl@gnu.org)

	* config/obj-elf.c (obj_elf_symver): Check missing version
	name.

Index: config/obj-elf.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/obj-elf.c,v
retrieving revision 1.1.1.21
diff -u -p -r1.1.1.21 obj-elf.c
--- config/obj-elf.c	2000/11/08 00:30:26	1.1.1.21
+++ config/obj-elf.c	2000/11/09 00:45:59
@@ -1127,12 +1126,16 @@ obj_elf_symver (ignore)
 
   if (symbol_get_obj (sym)->versioned_name == NULL)
     {
+      char *p, *rp;
+
       symbol_get_obj (sym)->versioned_name = xstrdup (name);
 
       *input_line_pointer = c;
 
-      if (strchr (symbol_get_obj (sym)->versioned_name,
-				  ELF_VER_CHR) == NULL)
+      p = strchr (symbol_get_obj (sym)->versioned_name, ELF_VER_CHR);
+      if (p)
+	rp = strrchr (p, ELF_VER_CHR);
+      if (!p || p [1] == '\0' || rp [1] == '\0') 
 	{
 	  as_bad (_("missing version name in `%s' for symbol `%s'"),
 		  symbol_get_obj (sym)->versioned_name,

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