Skip to content

Commit

Permalink
abstract weak externals
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jul 8, 2012
1 parent ede6685 commit 5a12447
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 11 additions & 5 deletions src/backend/cgobj.c
Expand Up @@ -1201,11 +1201,15 @@ STATIC void obj_defaultlib()
*/

void obj_wkext(Symbol *s1,Symbol *s2)
{ char buffer[2+2+2];
int i;
int x2;
{
//printf("obj_wkext(%s)\n", s1->Sident);
if (I32)
{
// Optlink crashes with weak symbols at EIP 41AFE7, 402000
return;
}

printf("obj_wkext(%s)\n", s1->Sident);
int x2;
if (s2)
x2 = s2->Sxtrnnum;
else
Expand All @@ -1217,9 +1221,11 @@ void obj_wkext(Symbol *s1,Symbol *s2)
x2 = obj.nullext;
}
outextdata();

char buffer[2+2+2];
buffer[0] = 0x80;
buffer[1] = 0xA8;
i = 2;
int i = 2;
i += insidx(&buffer[2],s1->Sxtrnnum);
i += insidx(&buffer[i],x2);
objrecord(COMENT,buffer,i);
Expand Down
2 changes: 0 additions & 2 deletions src/toobj.c
Expand Up @@ -180,9 +180,7 @@ void Module::genmoduleinfo()
* they resolve to 0 if not pulled in by something else.
* Don't pull in a module just because it was imported.
*/
#if !OMFOBJ // Optlink crashes with weak symbols at EIP 41AFE7, 402000
s->Sflags |= SFLweak;
#endif
dtxoff(&dt, s, 0, TYnptr);
}
}
Expand Down

0 comments on commit 5a12447

Please sign in to comment.