This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cr16-elf tools error: no .eh_frame_hdr table will be created.

On Fri, Jul 03, 2009 at 03:53:45PM +0530, M R Swami Reddy wrote:
> Btw, I think, no need to do or fix in TC_LINKER_RELAX_FIXUP here.
> It looks like an issue with section flags setting or else.

No, if you make .eh_frame a non-allocated section, it won't be in
memory.  How will the unwinder work without its unwinding info?

The following patch will cause non-code section fixups to be resolved
at assembly time, while code fixups will result in relocations that
the linker will be able to use for relaxation.  Since the linker
doesn't even relax non-code sections (see elf32_cr16_relax_section)
there is no point in emitting extra relocs for sections like
.eh_frame.  Applied.

	* config/tc-cr16.h (TC_LINKRELAX_FIXUP): Set only for code sections.

Index: gas/config/tc-cr16.h
RCS file: /cvs/src/src/gas/config/tc-cr16.h,v
retrieving revision 1.3
diff -u -p -r1.3 tc-cr16.h
--- gas/config/tc-cr16.h	27 Nov 2008 11:57:29 -0000	1.3
+++ gas/config/tc-cr16.h	4 Jul 2009 01:32:57 -0000
@@ -1,5 +1,5 @@
 /* tc-cr16.h -- Header file for tc-cr16.c, the CR16 GAS port.
-   Copyright 2007 Free Software Foundation, Inc.
+   Copyright 2007, 2009 Free Software Foundation, Inc.
    Contributed by M R Swami Reddy <>
@@ -49,8 +49,9 @@ extern const struct relax_type md_relax_
 #define TC_FORCE_RELOCATION(FIXP) cr16_force_relocation (FIXP)
 extern int cr16_force_relocation (struct fix *);
-/* Fixup debug sections since we will never relax them.  */
-#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
+/* Fixup non-code sections since we will never relax them.  */
+#define TC_LINKRELAX_FIXUP(seg) \
+  ((seg->flags & (SEC_ALLOC | SEC_CODE)) == (SEC_ALLOC | SEC_CODE))
 /* CR16 instructions, with operands included, are a multiple
    of two bytes long.  */

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]