-#if 0
-//
-// Add symbol to the hash table if it doesn't already exist, otherwise decide
-// what to do since it's already defined in another unit.
-//
-int DealWithSymbol(char * sym, long type, long value, struct OFILE * ofile)
-{
- // Make sure we have a filename...
- assert(ofile->o_name[0] != 0);
-
- if (vflag > 1)
- {
- printf("DealWithSymbol(%s,%s,%lx,", sym, ofile->o_name, value);
- printf("%x,%s)\n", (unsigned int)type, (isglobal(type) ? "GLOBAL" : "COMMON"));
- }
-
- // See if the symbol is already in the symbol table...
- struct HREC * hptr = LookupHREC(sym);
-
- if (hptr == NULL)
- return AddSymbolToHashList(&htable[GetHash(sym)], sym, ofile, value, type);
-
- // N.B.: The symbol being passed in is *already* been vetted as an
- // external, so we have only *two* cases to look for here.
-#if 0
- // Symbol is already in table... Figure out how to handle!
- if (iscommon(type) && !iscommon(hptr->h_type))
- {
- // Mismatch: global came first; warn and keep the global one
- if (wflag)
- {
- printf("Warning: %s: global from ", sym);
- put_name(hptr->h_ofile);
- printf(" used, common from ");
- put_name(ofile);
- printf(" discarded.\n");
- }
-
-#if 0
-#warning "!!! WHERE THE FUCK IS THIS WRITING TO?? !!!"
-// Wow, just wow. This is writing to the symbol string table when it apparently
-// it thinks it's writing to an ABS symbol. This is so wrong, I don't even know
-// where to begin...
- putword(sym + 8, ABST_EXTERN);
- putlong(sym + 10, 0L);
-#else
- // ??? write what to where?
-#endif
- }
- else if (iscommon(hptr->h_type) && !iscommon(type))
- {
- // Mismatch: common came first; warn and keep the global one
- if (wflag)
- {
- printf("Warning: %s: global from ", sym);
- put_name(ofile);
- printf(" used, common from ");
- put_name(hptr->h_ofile);
- printf(" discarded.\n");
- }
-
- hptr->h_type = type;
- hptr->h_ofile = ofile;
- hptr->h_value = value;
- }
- // They're both global [WRONG! Passed in one is global]
- // [technically, this is correct, as it failed the 1st two checks...
- // but it is unclear, so the latter is preferable.]
-// else if (!iscommon(type))
-//is this now right?? [YES, see above]
- else if (!iscommon(type) && !iscommon(hptr->h_type))
- {
- // Global exported by another ofile; warn and make this one extern
- if (wflag)
- {
- printf("Duplicate symbol %s: ", sym);
- put_name(hptr->h_ofile);
- printf(" used, ");
- put_name(ofile);
- printf(" discarded\n");
- }
-
-#if 0
-#warning "!!! WHERE THE FUCK IS THIS WRITING TO?? !!!"
- putword(sym + 8, ABST_EXTERN);
-#else
- // ??? write what to where?
-#endif
- }
- // They're both common
- else
- {
- if (hptr->h_value < value)
- {
- hptr->h_value = value;
- hptr->h_ofile = ofile;
- }
- }
-#else
- if (iscommon(hptr->h_type))
- {
- // Mismatch: common came first; warn and keep the global one
- if (wflag)
- {
- printf("Warning: %s: global from ", sym);
- put_name(ofile);
- printf(" used, common from ");
- put_name(hptr->h_ofile);
- printf(" discarded.\n");
- }
-
- hptr->h_type = type;
- hptr->h_ofile = ofile;
- hptr->h_value = value;
- }
- else
- {
- // Global exported by another ofile; warn and make this one extern
- if (wflag)
- {
- printf("Duplicate symbol %s: ", sym);
- put_name(hptr->h_ofile);
- printf(" used, ");
- put_name(ofile);
- printf(" discarded\n");
- }
-
-#if 0
-#warning "!!! WHERE THE FUCK IS THIS WRITING TO?? !!!"
- putword(sym + 8, ABST_EXTERN);
-#else
- // ??? write what to where?
-#endif
- }
-#endif
-
- return 0;
-}
-#endif
-
-