This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix i686-darwin after my pic base patch
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org, Geoff Keating <geoffk at geoffk dot org>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Mon, 18 Aug 2003 21:04:02 -0400
- Subject: [PATCH] Fix i686-darwin after my pic base patch
I missed this when I testing my pic base patch because I could not
figure out
how really to do a cross compiler but I finally figured out and found
some
problems caused by my pic base patch. These changes are needed as x86
has more
changes for darwin support in its config file than rs6000 does.
To build a cross compiler on Mac OS X with x86 headers installed in
/usr/include
is to ../configure --with-sysroot=/ --target=i686-apple-darwin6.6
--with-as=/usr/libexec/gcc/darwin/i386/as --with-ld=/usr/bin/ld.
Now I have a full capable cross compiler that works except for ld
problems.
Both of these changes are under TARGET_MACHO.
Okay?
Thanks,
Andrew Pinski
ChangeLog:
* config/i386/i386.c (legitimate_pic_address_disp_p): Change the
strstr with $pb to a strcompare with "<pic base>"
(ix86_output_addr_diff_elt): Output the real pic base.
Patch:
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.593
diff -u -p -r1.593 i386.c
--- i386.c 16 Aug 2003 11:04:59 -0000 1.593
+++ i386.c 19 Aug 2003 00:14:31 -0000
@@ -5715,7 +5715,7 @@ legitimate_pic_address_disp_p (register
if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF)
{
const char *sym_name = XSTR (XEXP (disp, 1), 0);
- if (strstr (sym_name, "$pb") != 0)
+ if (! strcmp (sym_name, "<pic base>"))
return 1;
}
}
@@ -8027,8 +8027,11 @@ ix86_output_addr_diff_elt (FILE *file, i
fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
#if TARGET_MACHO
else if (TARGET_MACHO)
- fprintf (file, "%s%s%d-%s\n", ASM_LONG, LPREFIX, value,
- machopic_function_base_name () + 1);
+ {
+ fprintf (file, "%s%s%d-", ASM_LONG, LPREFIX, value);
+ machopic_output_function_base_name (file);
+ fprintf(file, "\n");
+ }
#endif
else
asm_fprintf (file, "%s%U%s+[.-%s%d]\n",