This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Patch for 64-bit change address in 32-bit environment
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: Patch for 64-bit change address in 32-bit environment
- From: Andreas Jaeger <aj at suse dot de>
- Date: 03 May 2000 11:50:56 +0200
- Cc: ulfc at calypso dot engr dot sgi dot com, binutils at sourceware dot cygnus dot com
- References: <Pine.LNX.4.21.0004082353520.9740-100000@calypso.engr.sgi.com><20000410211052.18026.qmail@daffy.airs.com>
>>>>> Ian Lance Taylor writes:
Ian> Date: Sun, 9 Apr 2000 00:11:06 -0700 (PDT)
Ian> From: Ulf Carlsson <ulfc@calypso.engr.sgi.com>
Ian> The current implementation of set_section_start() can't handle 64-bit addresses
Ian> if you've compiled the 64-bit linker in a 32-bit environment. The problem
Ian> is that strtoul() uses unsigned longs. I have attached a workaround for this.
Ian> 2000-04-09 Ulf Carlsson <ulfc@engr.sgi.com>
Ian> * lexsup.c (set_section_start): Handle 64-bit addresses is 32-bit
Ian> compiling environments.
Ian> Thanks for the patch.
Ian> I think we should probably just use bfd_scan_vma instead of strtoul.
Like this? Ulf, does this also work for you?
Andreas
2000-05-03 Andreas Jaeger <aj@suse.de>
* lexsup.c (set_section_start): Use bfd_scan_vma instead of
strtoul.
Index: ld/lexsup.c
===================================================================
RCS file: /cvs/src/src/ld/lexsup.c,v
retrieving revision 1.9
diff -u -r1.9 lexsup.c
--- lexsup.c 2000/04/04 14:32:33 1.9
+++ lexsup.c 2000/05/03 08:58:33
@@ -1051,7 +1051,7 @@
char *sect, *valstr;
{
char *end;
- unsigned long val = strtoul (valstr, &end, 16);
+ unsigned long val = bfd_scan_vma (valstr, (CONST char **)&end, 16);
if (*end)
einfo (_("%P%F: invalid hex number `%s'\n"), valstr);
lang_section_start (sect, exp_intop (val));
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de