Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#137 closed defect (fixed)

emxomf: Don't truncate symbols twice. — at Version 2

Reported by: Yuri Dario Owned by: bird
Priority: normal Milestone: libc-0.6.2
Component: emx Version: 0.6.1
Severity: normal Keywords:
Cc:

Description (last modified by bird)

Very long c++ symbols, already hashed after .o generation, are re-hashed when a .a import library is converted to .lib. The new symbol has the same length of previous one, so this is not necessary, and triggers a bug, since import library has different names.

Fix: do not truncate if the symbol is already hashed:

Index: emxomf.c
===================================================================
--- emxomf.c	(revision 2893)
+++ emxomf.c	(working copy)
@@ -808,6 +808,7 @@
 static void put_nstr(const char *pszName, size_t cch)
 {
     if (    cch > SYMBOL_MAX_LENGTH
+        &&  !strstr(pszName + SYMBOL_MAX_LENGTH - SYMBOL_HASH_LENGTH, "!_")
         &&  !strstr(pszName + SYMBOL_MAX_LENGTH - SYMBOL_WEAK_LENGTH, "$w$"))
     {
         /* Hash the symbol to help making it unique.

Maybe strncmp can be used to check exactly for the initial two bytes of hash.

Change History (2)

comment:1 by bird, 18 years ago

Resolution: fixed
Status: newclosed

(In [2984]) Guard against double truncation. Fixes #137

comment:2 by bird, 18 years ago

Description: modified (diff)
Summary: emxomf truncates hashed symbols when converting .a to .libemxomf: Don't truncate symbols twice.
Note: See TracTickets for help on using tickets.