Opened 17 years ago

Last modified 17 years ago

#137 closed defect

emxomf truncates hashed symbols when converting .a to .lib — at Initial Version

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

Very long c++ symbols, already hashed after .o generation, are re-hashed when .a import library is converted to .lib format. 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 check for len if !_ is present in the last SYMBOL_HASH_LENGHT bytes

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 (0)

Note: See TracTickets for help on using tickets.