bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for the nlmheader.y file


From: Jon Carey
Subject: Patch for the nlmheader.y file
Date: Tue, 29 Jul 2003 11:05:59 -0600

I changed the nlmheader.y file so numeric parameters to various linker
commands could be specified in hex.
The problem:
If I link my NLM on the Windows platform using the tools provided in
the Novell Developer Kit (NLMLINK) and I wan't to specify the TSR flag
for the NLM, I would do it with the following line in my def file:
FLAG_ON 0x01000000

If I link my NLM on the Windows platform using nlmconv and I wan't to
specify the TSR flag for the NLM, I would to do it with the following
line in my def file:
FLAG_ON 16777216

With the change I made to the src/binutils/nlmheader.y file you can now
do the following:
FLAG_ON 0x01000000
FLAG_ON 16777216
FLAG_ON 0100000000

This change allows numeric parameters to be specified this way on the
following linker commands:
FLAG_ON
FLAG_OFF
STACK
STACKSIZE
TYPE
VERSION

All I did was change to base parameter from "10" to "0" in the call to
strtol in the nlmlex_get_number function in nlmheader.y.

I have attached the patch file for this change to this email. this
patch is for the file src/binutils/nlmheader.y only.
If you have problems with attachements, here is the contents of the
patch file (very small):
--- nlmheader.y.ORIG    2003-07-29 10:22:19.000000000 -0600
+++ nlmheader.y 2003-07-29 10:27:30.000000000 -0600
@@ -863,7 +863,10 @@
   long ret;
   char *send;
 
-  ret = strtol (s, &send, 10);
+  /* Using '0' as the base, lets strtol deal with
+     decimal(base 10) or hex (0x prefix)
+        or octal (0 prefix) */
+  ret = strtol (s, &send, 0);
   if (*send != '\0')
     nlmheader_warn (_("bad number"), -1);
   return ret;


Jon Carey
Novell, Inc., the leading provider of information solutions
http://www.novell.com

Attachment: mypatch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]