This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Building binutils source package for power pc fails
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: sudesh ram <sudesh dot ram at thales-tts dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 28 Aug 2002 11:24:23 +0930
- Subject: Re: Building binutils source package for power pc fails
- References: <3D6B8A31.7490527@thales-tts.com>
On Tue, Aug 27, 2002 at 03:18:25PM +0100, sudesh ram wrote:
> eaixppc.o(.text+0x81e):eaixppc.c: undefined reference to `strtoll'
> eaixppc.o(.text+0x8cd):eaixppc.c: undefined reference to `strtoull'
> eaixppc.o(.text+0xa1d):eaixppc.c: undefined reference to `strtoull'
> eaixppc.o(.text+0xa5d):eaixppc.c: undefined reference to `strtoull'
> eaixppc.o(.text+0xb1d):eaixppc.c: undefined reference to `strtoull'
> eaixppc.o(.text+0xbc4):eaixppc.c: undefined reference to `strtoull'
This should fix it.
* emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Replace strtoll,
strtoul and strtoull with bfd_scan_vma.
(gld${EMULATION_NAME}_read_file): Likewise.
Replacing strtoul with bfd_scan_vma in the 'H' case (alignment value)
isn't really necessary, but shouldn't hurt. The strtoul replacement
in read_file is (I think) a bugfix.
Index: ld/emultempl/aix.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/aix.em,v
retrieving revision 1.27
diff -u -p -r1.27 aix.em
--- ld/emultempl/aix.em 6 Aug 2002 11:40:30 -0000 1.27
+++ ld/emultempl/aix.em 28 Aug 2002 01:51:50 -0000
@@ -180,7 +180,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
int longind;
int optc;
bfd_signed_vma val;
- char *end;
+ const char *end;
enum
{
@@ -319,7 +319,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
break;
case 'D':
- val = strtoll (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
einfo ("%P: warning: ignoring invalid -D number %s\n", optarg);
else if (val != -1)
@@ -327,7 +327,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
break;
case 'H':
- val = strtoul (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0' || (val & (val - 1)) != 0)
einfo ("%P: warning: ignoring invalid -H number %s\n", optarg);
else
@@ -345,7 +345,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
number, we assume the AIX option is intended. Otherwise, we
assume the usual GNU ld -T option is intended. We can't just
ignore the AIX option, because gcc passes it to the linker. */
- val = strtoull (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
{
optind = prevoptind;
@@ -430,7 +430,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
break;
case OPTION_MAXDATA:
- val = strtoull (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
einfo ("%P: warning: ignoring invalid -bmaxdata number %s\n", optarg);
else
@@ -438,7 +438,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
break;
case OPTION_MAXSTACK:
- val = strtoull (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
einfo ("%P: warning: ignoring invalid -bmaxstack number %s\n",
optarg);
@@ -471,7 +471,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
start on. The offset within the page should still be the
offset within the file, so we need to build an appropriate
expression. */
- val = strtoull (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg);
else
@@ -494,7 +494,7 @@ gld${EMULATION_NAME}_parse_args (argc, a
/* This set the page that the .text section is supposed to start
on. The offset within the page should still be the offset
within the file. */
- val = strtoull (optarg, &end, 0);
+ val = bfd_scan_vma (optarg, &end, 0);
if (*end != '\0')
einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg);
else
@@ -1112,14 +1112,14 @@ gld${EMULATION_NAME}_read_file (filename
if (s != se)
{
int status;
- char *end;
+ const char *end;
status = is_syscall (s, &syscall_flag);
if (0 > status)
{
/* not a system call, check for address */
- address = strtoul (s, &end, 0);
+ address = bfd_scan_vma (s, &end, 0);
if (*end != '\0')
{
einfo ("%s:%d: warning: syntax error in import/export file\n",
--
Alan Modra
IBM OzLabs - Linux Technology Centre