- if ((type - T_EXT))
- {
- // Then add to hash table
- if (hash_add(symbol, type, value, Ofile))
- {
- return 1; // Error if addition failed
- }
- }
- else
- {
- // If value is zero and in hash table
- if ((hptr = lookup(symbol)) != NULL)
- {
- hptr->h_ofile->o_flags |= O_USED; // Mark symbol as used
- }
- // Otherwise add to unresolved list
- else if (add_unresolved(symbol, Ofile))
- {
- return 1; // Error if addition failed
- }
- }
+ if ((type & T_EXT) && (type & (T_SEG | T_ABS)))
+ if (AddARSymbol(symbol, Ofile))
+ return 1;
+ }
+ else if (type == T_EXT)
+ {
+ // External symbal that is *not* in the current unit
+ hptr = LookupHREC(symbol);
+
+ if (hptr != NULL)
+ hptr->h_ofile->o_flags |= O_USED; // Mark .o file as used
+ // Otherwise add to unresolved list
+ else if (AddUnresolvedSymbol(symbol, Ofile))
+ return 1; // Error if addition failed
+ }
+ else if ((type & T_EXT) && (type & (T_SEG | T_ABS)))
+ {
+ // Symbol in the current unit that is also EXPORTED
+ if (DealWithSymbol(symbol, type, value, Ofile))
+ return 1; // Error if addition failed