This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/5] gas: Add md_generic_table_relax_frag
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 3 Dec 2019 11:02:20 -0800
- Subject: [PATCH 2/5] gas: Add md_generic_table_relax_frag
- References: <20191203190223.26701-1-hjl.tools@gmail.com>
Add md_generic_table_relax_frag for TC_GENERIC_RELAX_TABLE targets so
that a backend can extend relax_frag beyond TC_GENERIC_RELAX_TABLE.
* write.c (relax_segment): Call md_generic_table_relax_frag
instead of relax_frag if defined.
---
gas/write.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gas/write.c b/gas/write.c
index 8f7786eb36..35b86ba976 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -3030,7 +3030,12 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass)
#ifdef TC_GENERIC_RELAX_TABLE
/* The default way to relax a frag is to look through
TC_GENERIC_RELAX_TABLE. */
+#ifdef md_generic_table_relax_frag
+ growth = md_generic_table_relax_frag (segment, fragP,
+ stretch);
+#else
growth = relax_frag (segment, fragP, stretch);
+#endif /* md_generic_table_relax_frag */
#endif /* TC_GENERIC_RELAX_TABLE */
#endif
break;
--
2.21.0