X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f X-Recipient: djgpp-workers AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=I2xhXbXdn6J/HYcIEfVcGNdjY4mWHLwbanG6GFnSMhE=; b=xPEQ7kBXTWUTrjcBaNZylGcnJZzt4xdpblY9I57lJ+s3CkKnixjqAaDuoGNXZ18zLL u0qgth84lCa7aNX5qO9SrH6qSI7hnFtyQIvF/tx2K7vh6Qao6XAXu3mcEFQNLa1SBtfy tEHXCnMZpApzZ5UedYaG6URPSU8W4MiShZY9c= MIME-Version: 1.0 Date: Sun, 3 Jul 2011 19:07:57 +0300 Message-ID: Subject: dxe3gen 1.0.1 patch From: Ozkan Sezer To: djgpp-workers AT delorie DOT com Content-Type: text/plain; charset=ISO-8859-1 Reply-To: djgpp-workers AT delorie DOT com Are there any plans to merge Daniel Borca's latest dxe3 stuff? http://www.geocities.ws/dborca/djgpp/dxe3/dxe3.html -> http://www.geocities.ws/dborca/djgpp/dxe3/dxe3_11s.zip -> fixed weak symbols A diff of the changes to djgpp-cvs existing code follows. --- djgpp-20110702/src/dxe/dxe3gen.c~ 2003-11-04 19:41:46.000000000 +0200 +++ dxe3gen.c 2011-07-02 11:41:21.000000000 +0300 @@ -31,7 +31,7 @@ #include "../../include/coff.h" #endif -#define VERSION "1.0" +#define VERSION "1.0.1" #define TEMP_BASE "dxe_tmp" /* 7 chars, 1 char suffix */ #define TEMP_O_FILE TEMP_BASE".o" @@ -610,12 +610,20 @@ static int write_dxe (FILE *inf, FILE *o ); #endif - if (sym[i].e_scnum == 0) { + /* do not process private symbols */ + if (sym[i].e_sclass == C_STAT) { + /* usually, private symbols are discarded anyway. + * This is because we end up with neither relative, + * nor absolute relocs pointing to them. However, + * C++ causes some trouble, apparently related to + * weak symbols. They will have only one absolute + * reloc to themselves. + */ + } else if (sym[i].e_scnum == 0) { short *count; long *rel_relocs, *abs_relocs; int n_abs_relocs = 0, n_rel_relocs = 0; - /* unresolved symbol */ /* count the amount of relocations pointing to this symbol */ for (j = 0; j < sc.s_nreloc; j++) { if (relocs[j].r_symndx == i) { @@ -632,6 +640,7 @@ static int write_dxe (FILE *inf, FILE *o continue; } + /* unresolved symbol */ dh.n_unres_syms++; if (!opt.unresolved) { Regards. -- O.S.