This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Xtensa] skip .eh_frame in property tables
- From: Bob Wilson <bwilson at tensilica dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 08 Aug 2008 11:25:54 -0700
- Subject: [Xtensa] skip .eh_frame in property tables
This patch from Sterling Augustine avoids generating Xtensa property table
information for .eh_frame sections, since the linker optimizes the contents of
.eh_frame and there is no need for .eh_frame property tables anyway. Tested
with an xtensa-elf build and committed.
2008-08-08 Sterling Augustine <sterling@tensilica.com>
* config/tc-xtensa.c (exclude_section_from_property_tables): New.
(xtensa_create_property_segments): Use it.
(xtensa_create_xproperty_segments): Likewise.
Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.101
diff -u -p -r1.101 tc-xtensa.c
--- config/tc-xtensa.c 7 May 2008 23:13:09 -0000 1.101
+++ config/tc-xtensa.c 8 Aug 2008 18:10:24 -0000
@@ -10320,6 +10320,7 @@ static void xtensa_create_property_segme
(frag_predicate, frag_predicate, const char *, xt_section_type);
static void xtensa_create_xproperty_segments
(frag_flags_fn, const char *, xt_section_type);
+static bfd_boolean exclude_section_from_property_tables (segT);
static bfd_boolean section_has_property (segT, frag_predicate);
static bfd_boolean section_has_xproperty (segT, frag_flags_fn);
static void add_xt_block_frags
@@ -10383,12 +10384,8 @@ xtensa_create_property_segments (frag_pr
seclist = &(*seclist)->next)
{
segT sec = *seclist;
- flagword flags;
- flags = bfd_get_section_flags (stdoutput, sec);
- if (flags & SEC_DEBUGGING)
- continue;
- if (!(flags & SEC_ALLOC))
+ if (exclude_section_from_property_tables (sec))
continue;
if (section_has_property (sec, property_function))
@@ -10485,12 +10482,8 @@ xtensa_create_xproperty_segments (frag_f
seclist = &(*seclist)->next)
{
segT sec = *seclist;
- flagword flags;
- flags = bfd_get_section_flags (stdoutput, sec);
- if ((flags & SEC_DEBUGGING)
- || !(flags & SEC_ALLOC)
- || (flags & SEC_MERGE))
+ if (exclude_section_from_property_tables (sec))
continue;
if (section_has_xproperty (sec, flag_fn))
@@ -10574,6 +10567,27 @@ xtensa_create_xproperty_segments (frag_f
static bfd_boolean
+exclude_section_from_property_tables (segT sec)
+{
+ flagword flags = bfd_get_section_flags (stdoutput, sec);
+
+ /* Sections that don't contribute to the memory footprint are excluded. */
+ if ((flags & SEC_DEBUGGING)
+ || !(flags & SEC_ALLOC)
+ || (flags & SEC_MERGE))
+ return TRUE;
+
+ /* Linker cie and fde optimizations mess up property entries for
+ eh_frame sections, but there is nothing inside them relevant to
+ property tables anyway. */
+ if (strcmp (sec->name, ".eh_frame") == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+
+static bfd_boolean
section_has_property (segT sec, frag_predicate property_function)
{
segment_info_type *seginfo = seg_info (sec);