From: ceriel Date: Thu, 21 Nov 1996 10:14:26 +0000 (+0000) Subject: Added -n flag X-Git-Tag: release-5-5~38 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=56033dc0c1fb81566a9d6b222d7cb43e4258c0f5;p=ack.git Added -n flag --- diff --git a/util/led/const.h b/util/led/const.h index 26a97a380..40ad395b5 100644 --- a/util/led/const.h +++ b/util/led/const.h @@ -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. */ diff --git a/util/led/led.6 b/util/led/led.6 index b3fa2eca3..c89866efe 100644 --- a/util/led/led.6 +++ b/util/led/led.6 @@ -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 diff --git a/util/led/main.c b/util/led/main.c index 6517c6322..81fde572a 100644 --- a/util/led/main.c +++ b/util/led/main.c @@ -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(); }