GetString (S->Name),
AddrSizeToStr (S->AddrSize));
- /* If this is not an import, output its value and - if we have
- * it - the segment.
- */
- if (!SYM_IS_IMPORT (S->Type)) {
-
- SegExprDesc D;
-
- /* Get the symbol value */
- long Val = GetDbgSymVal (S);
-
- /* Output it */
- fprintf (F, ",val=0x%lX", Val);
-
- /* Check for a segmented expression and add the segment id to
- * the debug info if we have one.
- */
- GetSegExprVal (S->Expr, &D);
- if (!D.TooComplex && D.Seg != 0) {
- fprintf (F, ",seg=%u", D.Seg->Id);
- }
-
- /* Output the type */
- fprintf (F, ",type=%s", SYM_IS_LABEL (S->Type)? "lab" : "equ");
-
- } else {
- /* Output the type */
- fputs (",type=imp", F);
- }
-
/* Emit the size only if we know it */
if (S->Size != 0) {
fprintf (F, ",size=%u", S->Size);
fprintf (F, ",parent=%u", O->SymBaseId + S->OwnerId);
}
- /* If this is an import, output the id of the matching export */
+ /* If this is an import, output the id of the matching export.
+ * If this is not an import, output its value and - if we have
+ * it - the segment.
+ */
if (SYM_IS_IMPORT (S->Type)) {
/* Get the import */
/* Get the export from the import */
const Export* Exp = Imp->Exp;
- /* If this is not a linker generated symbol, output the debug
+ /* Output the type */
+ fputs (",type=imp", F);
+
+ /* If this is not a linker generated symbol, and the module
+ * that contains the export has debug info, output the debug
* symbol id for the export
*/
- if (Exp->Obj) {
+ if (Exp->Obj && OBJ_HAS_DBGINFO (Exp->Obj->Header.Flags)) {
fprintf (F, ",exp=%u", Exp->Obj->SymBaseId + Exp->DbgSymId);
}
+
+ } else {
+
+ SegExprDesc D;
+
+ /* Get the symbol value */
+ long Val = GetDbgSymVal (S);
+
+ /* Output it */
+ fprintf (F, ",val=0x%lX", Val);
+
+ /* Check for a segmented expression and add the segment id to
+ * the debug info if we have one.
+ */
+ GetSegExprVal (S->Expr, &D);
+ if (!D.TooComplex && D.Seg != 0) {
+ fprintf (F, ",seg=%u", D.Seg->Id);
+ }
+
+ /* Output the type */
+ fprintf (F, ",type=%s", SYM_IS_LABEL (S->Type)? "lab" : "equ");
}
/* Terminate the output line */