Added -n flag
authorceriel <none@none>
Thu, 21 Nov 1996 10:14:26 +0000 (10:14 +0000)
committerceriel <none@none>
Thu, 21 Nov 1996 10:14:26 +0000 (10:14 +0000)
util/led/const.h
util/led/led.6
util/led/main.c

index 26a97a3..40ad395 100644 (file)
@@ -15,6 +15,7 @@ typedef int           bool;
 #define RFLAG          0x01            /* -r flag given.               */
 #define SFLAG          0x02            /* -s flag given.               */
 #define CFLAG          0x04            /* -c flag given.               */
+#define NFLAG          0x08            /* -n flag given.               */
 
 #define PLAIN          0               /* Input file is a normal file. */
 #define ARCHIVE                1               /* Input file is an archive.    */
index b3fa2ec..c89866e 100644 (file)
@@ -102,6 +102,12 @@ be resolved.
 This may be useful for machines that need a last relocation step
 at load time. This flag disables the \fB\-r\fP flag.
 .TP
+.B \-n
+Usually, after linking, a value in the namelist represents an absolute
+address. Sometimes, particularly when using the \fB\-c\fR flag, it may be
+useful to have as value the offset with respect to the beginning of the
+corresponding section. The \fB\-n\fR flag enables this.
+.TP
 .B  \-s
 `Strip' the output, that is, remove the name table
 and relocation information to save space (but impair the
index 6517c63..81fde57 100644 (file)
@@ -175,6 +175,14 @@ first_pass(argv)
                        DEB = 1;
                        break;
 #endif
+               case 'n':
+                       /* In the resulting name list, leave offsets with
+                          respect to the beginning of the section instead
+                          of absolute addresses.
+                       */
+                       flagword |= NFLAG;
+                       break;
+
                case 'o':
                        /*
                         * The `name' argument after -o is used as name
@@ -367,7 +375,7 @@ evaluate()
 {
        norm_commons();
        complete_sections();
-       if (!(flagword&RFLAG))
+       if (!(flagword&(RFLAG|NFLAG)))
                change_names();
 }