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
This commit is contained in:
parent
a6cc7e85de
commit
59d8fe2722
@ -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
|
||||
|
@ -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
|
||||
|
@ -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) \
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user