BSD 3 development
[unix-history] / usr / src / cmd / nm.c
index 46ea4f8..1c620f3 100644 (file)
 #include       <stdio.h>
 #include       <ctype.h>
 #include       <a.out.h>
 #include       <stdio.h>
 #include       <ctype.h>
 #include       <a.out.h>
+#include       <pagsiz.h>
+
 #define        MAGIC   exp.a_magic
 #define        BADMAG  MAGIC!=A_MAGIC1 && MAGIC!=A_MAGIC2  \
 #define        MAGIC   exp.a_magic
 #define        BADMAG  MAGIC!=A_MAGIC1 && MAGIC!=A_MAGIC2  \
-               && MAGIC!=A_MAGIC3 && MAGIC!=A_MAGIC4
+               && MAGIC!=A_MAGIC3 && MAGIC!=A_MAGIC4 && MAGIC != 0412 && MAGIC != 0413
 #define        SELECT  arch_flg ? arp.ar_name : *argv
 int    numsort_flg;
 int    undef_flg;
 #define        SELECT  arch_flg ? arp.ar_name : *argv
 int    numsort_flg;
 int    undef_flg;
@@ -104,6 +106,8 @@ char **argv;
                        if (BADMAG)             /* archive element not in  */
                                continue;       /* proper format - skip it */
                        o = (long)exp.a_text + exp.a_data + exp.a_trsize + exp.a_drsize;
                        if (BADMAG)             /* archive element not in  */
                                continue;       /* proper format - skip it */
                        o = (long)exp.a_text + exp.a_data + exp.a_trsize + exp.a_drsize;
+                       if (MAGIC==0412 || MAGIC==0413)
+                               o += PAGSIZ - sizeof(struct exec);
                        fseek(fi, o, 1);
                        n = exp.a_syms / sizeof(struct nlist);
                        if (n == 0) {
                        fseek(fi, o, 1);
                        n = exp.a_syms / sizeof(struct nlist);
                        if (n == 0) {