This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix dw2gencfi.c for non BFD_ASSEMBLER builds
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 21 May 2003 12:20:49 +0100
- Subject: Fix dw2gencfi.c for non BFD_ASSEMBLER builds
Hi Guys,
The new file dw2gencfi.c does not compile for ports which do not
define BFD_ASSEMBLER. This patch fixes the problem.
Cheers
Nick
2003-05-21 Nick Clifton <nickc@redhat.com>
* dw2gencfi.c (cfi_get_label): Use symbol_make for non
BFD_ASSEMBLER targets.
(cfi_startproc): Change type of saved_seg and cfi_seg to segT.
(dot_cfi_endproc): Only call bfd_set_section_flags for targets
defining BFD_ASSEMBLER.
Index: dw2gencfi.c
===================================================================
RCS file: /cvs/src/src/gas/dw2gencfi.c,v
retrieving revision 1.3
diff -c -3 -p -w -r1.3 dw2gencfi.c
*** dw2gencfi.c 20 May 2003 14:31:44 -0000 1.3
--- dw2gencfi.c 21 May 2003 11:21:34 -0000
*************** cfi_get_label (void)
*** 351,372 ****
{
if ((S_GET_VALUE (symbolP) == frag_now_fix ())
&& (S_GET_SEGMENT (symbolP) == now_seg))
- {
return symbolP;
! }
snprintf (symname, sizeof (symname), "%s_0x%lx_%u",
symbase, (long) frag_now_fix (), i++);
}
symbolP = (symbolS *) local_symbol_make (symname, now_seg,
(valueT) frag_now_fix (),
frag_now);
return symbolP;
}
static void
dot_cfi_startproc (void)
{
const char *simple = "simple";
if (cfi_info)
{
--- 351,377 ----
{
if ((S_GET_VALUE (symbolP) == frag_now_fix ())
&& (S_GET_SEGMENT (symbolP) == now_seg))
return symbolP;
!
snprintf (symname, sizeof (symname), "%s_0x%lx_%u",
symbase, (long) frag_now_fix (), i++);
}
+ #ifdef BFD_ASSEMBLER
symbolP = (symbolS *) local_symbol_make (symname, now_seg,
(valueT) frag_now_fix (),
frag_now);
+ #else
+ symbolP = symbol_make (symname);
+ #endif
return symbolP;
}
static void
dot_cfi_startproc (void)
{
+ #ifdef tc_cfi_frame_initial_instructions
const char *simple = "simple";
+ #endif
if (cfi_info)
{
*************** dot_cfi_endproc (void)
*** 596,602 ****
char *cie_buf, *fde_buf, *pbuf, *where;
unsigned long buf_size, cie_size, fde_size, last_cie_offset;
unsigned long fde_initloc_offset, fde_len_offset, fde_offset;
! void *saved_seg, *cfi_seg;
expressionS exp;
if (! cfi_info)
--- 601,607 ----
char *cie_buf, *fde_buf, *pbuf, *where;
unsigned long buf_size, cie_size, fde_size, last_cie_offset;
unsigned long fde_initloc_offset, fde_len_offset, fde_offset;
! segT saved_seg, cfi_seg;
expressionS exp;
if (! cfi_info)
*************** dot_cfi_endproc (void)
*** 609,616 ****
--- 614,623 ----
/* Open .eh_frame section. */
saved_seg = now_seg;
cfi_seg = subseg_new (".eh_frame", 0);
+ #ifdef BFD_ASSEMBLER
bfd_set_section_flags (stdoutput, cfi_seg,
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+ #endif
subseg_set (cfi_seg, 0);
/* Build CIE. */