aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2005-01-05 18:39:43 +0000
committerStan Shebs <shebs@gcc.gnu.org>2005-01-05 18:39:43 +0000
commit59d8fe27225bbdeb958692a320caf77eb8fc9f17 (patch)
tree92090e557808239acca7de92b369dca94e57a36b
parenta6cc7e85debd2f43dd64c7ecdff9f5907270b381 (diff)
downloadgcc-59d8fe27225bbdeb958692a320caf77eb8fc9f17.zip
gcc-59d8fe27225bbdeb958692a320caf77eb8fc9f17.tar.gz
gcc-59d8fe27225bbdeb958692a320caf77eb8fc9f17.tar.bz2
unwind-dw2-fde-darwin.c (examine_objects): Use 64-bit Mach-O getters if ppc64.
* unwind-dw2-fde-darwin.c (examine_objects): Use 64-bit Mach-O getters if ppc64. * config/darwin.c (darwin_asm_output_dwarf_delta): Obey size argument. * config/darwin.h (ASM_PREFERRED_EH_DATA_FORMAT): Use signed four-byte field for global code case. (STARTFILE_SPEC): Avoid crt2.o for 64-bit compilation. From-SVN: r92962
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/darwin.c7
-rw-r--r--gcc/config/darwin.h10
-rw-r--r--gcc/unwind-dw2-fde-darwin.c13
4 files changed, 34 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7589a23..442e06d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2005-01-05 Stan Shebs <shebs@apple.com>
+
+ * unwind-dw2-fde-darwin.c (examine_objects): Use 64-bit
+ Mach-O getters if ppc64.
+ * config/darwin.c (darwin_asm_output_dwarf_delta): Obey
+ size argument.
+ * config/darwin.h (ASM_PREFERRED_EH_DATA_FORMAT): Use
+ signed four-byte field for global code case.
+ (STARTFILE_SPEC): Avoid crt2.o for 64-bit compilation.
+
2005-01-05 Roger Sayle <roger@eyesopen.com>
PR middle-end/19100
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index b95c438..cb3ba0a 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1358,21 +1358,22 @@ darwin_assemble_visibility (tree decl, int vis)
static int darwin_dwarf_label_counter;
void
-darwin_asm_output_dwarf_delta (FILE *file, int size ATTRIBUTE_UNUSED,
+darwin_asm_output_dwarf_delta (FILE *file, int size,
const char *lab1, const char *lab2)
{
int islocaldiff = (lab1[0] == '*' && lab1[1] == 'L'
&& lab2[0] == '*' && lab2[1] == 'L');
+ char *directive = (size == 8 ? ".quad" : ".long");
if (islocaldiff)
fprintf (file, "\t.set L$set$%d,", darwin_dwarf_label_counter);
else
- fprintf (file, "\t%s\t", ".long");
+ fprintf (file, "\t%s\t", directive);
assemble_name_raw (file, lab1);
fprintf (file, "-");
assemble_name_raw (file, lab2);
if (islocaldiff)
- fprintf (file, "\n\t.long L$set$%d", darwin_dwarf_label_counter++);
+ fprintf (file, "\n\t%s L$set$%d", directive, darwin_dwarf_label_counter++);
}
void
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 6afa6be..37a5e7c 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -322,6 +322,10 @@ extern const char *darwin_fix_and_continue_switch;
%{shared-libgcc:-lgcc_s -lgcc}} %{Zdynamiclib:-lgcc_s -lgcc}}}"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
+/* We don't want anything to do with crt2.o in the 64-bit case;
+ testing the PowerPC-specific -m64 flag here is a little irregular,
+ but it's overkill to make copies of this spec for each target
+ arch. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -329,11 +333,11 @@ extern const char *darwin_fix_and_continue_switch;
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \
%{!static:%{object:-lgcrt0.o} \
%{!object:%{preload:-lgcrt0.o} \
- %{!preload:-lgcrt1.o crt2.o%s}}}} \
+ %{!preload:-lgcrt1.o %{!m64: crt2.o%s}}}}} \
%{!pg:%{static:-lcrt0.o} \
%{!static:%{object:-lcrt0.o} \
%{!object:%{preload:-lcrt0.o} \
- %{!preload:-lcrt1.o crt2.o%s}}}}}}"
+ %{!preload:-lcrt1.o %{!m64: crt2.o%s}}}}}}}"
/* The native Darwin linker doesn't necessarily place files in the order
that they're specified on the link line. Thus, it is pointless
@@ -989,7 +993,7 @@ enum machopic_addr_class {
#undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((CODE) == 2 && (GLOBAL) == 1) \
- ? (DW_EH_PE_pcrel | DW_EH_PE_indirect) : \
+ ? (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) : \
((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
#define ASM_OUTPUT_DWARF_DELTA(FILE,SIZE,LABEL1,LABEL2) \
diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c
index 24cf3bc..12c9ed3 100644
--- a/gcc/unwind-dw2-fde-darwin.c
+++ b/gcc/unwind-dw2-fde-darwin.c
@@ -57,8 +57,11 @@ extern void _keymgr_set_and_unlock_processwide_ptr (int, void *);
extern void _keymgr_unlock_processwide_ptr (int);
struct mach_header;
+struct mach_header_64;
extern char *getsectdatafromheader (struct mach_header*, const char*,
const char *, unsigned long *);
+extern char *getsectdatafromheader_64 (struct mach_header*, const char*,
+ const char *, unsigned long *);
/* This is referenced from KEYMGR_GCC3_DW2_OBJ_LIST. */
struct km_object_info {
@@ -151,11 +154,21 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
char *fde;
unsigned long sz;
+#ifdef __ppc64__
+ fde = getsectdatafromheader_64 ((struct mach_header_64 *) image->mh,
+ "__DATA", "__eh_frame", &sz);
+#else
fde = getsectdatafromheader (image->mh, "__DATA", "__eh_frame", &sz);
+#endif
if (fde == NULL)
{
+#ifdef __ppc64__
+ fde = getsectdatafromheader_64 ((struct mach_header_64 *) image->mh,
+ "__TEXT", "__eh_frame", &sz);
+#else
fde = getsectdatafromheader (image->mh, "__TEXT",
"__eh_frame", &sz);
+#endif
if (fde != NULL)
image->examined_p |= IMAGE_IS_TEXT_MASK;
}