This is the mail archive of the mailing list for the GCC 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]

Fix link errors in C++ on Solaris

After Jason's recent changes, some symbols in libstdc++-v3 have been moved to 
read-only sections.  This uncovered a problem in the script 
used to build the versioning file for the Sun linker: it excludes symbols 
marked as 'R' by Sun nm, in order not to catch scratch register symbols of 
the SPARC architecture.  Now GNU nm precisely returns R for symbols present 
in read-only sections, so the moved symbols are missing with GNU nm.

Fortunately scratch register symbols have no symbol name so it's easy to tell 
the difference between the 2 kinds of 'R' symbols.

Tested on SPARC/Solaris 8, 9 and 10, with Sun nm and GNU nm, applied on the 
mainline as obvious.

2010-11-08  Eric Botcazou  <>

	* Ignore entries without symbol name first.  Then do
	not ignore symbols marked as 'R'.

Eric Botcazou
---	(revision 166350)
+++	(working copy)
@@ -58,9 +58,11 @@ while (<NM>) {
     # nm prints out stuff at the start, ignore it.
     next if (/^$/);
     next if (/:$/);
-    # Ignore register (SPARC only), undefined and local symbols.  The
-    # symbol name is optional; Sun nm emits none for local or .bss symbols.
-    next if (/^([^ ]+)?[ \t]+[RUa-z][ \t]+/);
+    # Ignore entries without symbol name.  Sun nm emits those for local, .bss
+    # or scratch register (SPARC only) symbols for example.
+    next if (/^ /);
+    # Ignore undefined and local symbols.
+    next if (/^[^ ]+[ \t]+[Ua-z][ \t]+/);
     # Ignore objects without symbol table.  Message goes to stdout with Sun
     # nm, while GNU nm emits the corresponding message to stderr.
     next if (/.* - No symbol table data/);

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