aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2004-03-19 22:43:28 +0000
committerBob Wilson <bob.wilson@acm.org>2004-03-19 22:43:28 +0000
commitbd260666dd84fb1c821f66029fe95dc5f559c2b3 (patch)
treebb19863645e3a268940a89b58859a6c0e23c1f7a
parent7be7bedeaaf8554f025c17edef0c9ab4f44ec858 (diff)
downloadgdb-bd260666dd84fb1c821f66029fe95dc5f559c2b3.zip
gdb-bd260666dd84fb1c821f66029fe95dc5f559c2b3.tar.gz
gdb-bd260666dd84fb1c821f66029fe95dc5f559c2b3.tar.bz2
* config/tc-xtensa.c (mark_literal_frags): New function.
(xtensa_move_literals): Call mark_literal_frags for all literal segments, including init and fini literal segments. (xtensa_post_relax_hook): Swap use of xt_insn_sec and xt_literal_sec.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-xtensa.c49
2 files changed, 39 insertions, 17 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 468b14f..58101a8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-19 Bob Wilson <bob.wilson@acm.org>
+
+ * config/tc-xtensa.c (mark_literal_frags): New function.
+ (xtensa_move_literals): Call mark_literal_frags for all literal
+ segments, including init and fini literal segments.
+ (xtensa_post_relax_hook): Swap use of xt_insn_sec and xt_literal_sec.
+
2004-03-17 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* config/tc-sh.c: Include dw2gencfi.h.
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index c011600..8f101db 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -638,6 +638,8 @@ static void xtensa_move_seg_list_to_beginning
PARAMS ((seg_list *));
static void xtensa_move_literals
PARAMS ((void));
+static void mark_literal_frags
+ PARAMS ((seg_list *));
static void xtensa_reorder_seg_list
PARAMS ((seg_list *, segT));
static void xtensa_reorder_segments
@@ -7485,21 +7487,9 @@ xtensa_move_literals ()
fixS *fix, *next_fix, **fix_splice;
sym_list *lit;
- /* As clunky as this is, we can't rely on frag_var
- and frag_variant to get called in all situations. */
-
- segment = literal_head->next;
- while (segment)
- {
- frchain_from = seg_info (segment->seg)->frchainP;
- search_frag = frchain_from->frch_root;
- while (search_frag)
- {
- search_frag->tc_frag_data.is_literal = TRUE;
- search_frag = search_frag->fr_next;
- }
- segment = segment->next;
- }
+ mark_literal_frags (literal_head->next);
+ mark_literal_frags (init_literal_head->next);
+ mark_literal_frags (fini_literal_head->next);
if (use_literal_section)
return;
@@ -7603,6 +7593,31 @@ xtensa_move_literals ()
}
+/* Walk over all the frags for segments in a list and mark them as
+ containing literals. As clunky as this is, we can't rely on frag_var
+ and frag_variant to get called in all situations. */
+
+static void
+mark_literal_frags (segment)
+ seg_list *segment;
+{
+ frchainS *frchain_from;
+ fragS *search_frag;
+
+ while (segment)
+ {
+ frchain_from = seg_info (segment->seg)->frchainP;
+ search_frag = frchain_from->frch_root;
+ while (search_frag)
+ {
+ search_frag->tc_frag_data.is_literal = TRUE;
+ search_frag = search_frag->fr_next;
+ }
+ segment = segment->next;
+ }
+}
+
+
static void
xtensa_reorder_seg_list (head, after)
seg_list *head;
@@ -7872,11 +7887,11 @@ xtensa_post_relax_hook ()
xtensa_create_property_segments (get_frag_is_insn,
XTENSA_INSN_SEC_NAME,
- xt_literal_sec);
+ xt_insn_sec);
if (use_literal_section)
xtensa_create_property_segments (get_frag_is_literal,
XTENSA_LIT_SEC_NAME,
- xt_insn_sec);
+ xt_literal_sec);
}