aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-06-12 16:17:53 +0000
committerIan Lance Taylor <ian@airs.com>1997-06-12 16:17:53 +0000
commit7799bb2c277915edc6461287bc2c9602f560bf79 (patch)
treef9e3115133d46e80a3e3e83e39942ed6d496f39b
parentbb2a6cfbfdfb95f8c8a58f8996c43dada425fad6 (diff)
downloadfsf-binutils-gdb-7799bb2c277915edc6461287bc2c9602f560bf79.zip
fsf-binutils-gdb-7799bb2c277915edc6461287bc2c9602f560bf79.tar.gz
fsf-binutils-gdb-7799bb2c277915edc6461287bc2c9602f560bf79.tar.bz2
* write.c (write_object_file): In non BFD_ASSEMBLER code, as we
step through the frags calling cvt_frag_to_fill, switch to SEG_DATA when we reach data_frag_root. PR 12580.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/write.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c1db9d4..e329610 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 12 12:16:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * write.c (write_object_file): In non BFD_ASSEMBLER code, as we
+ step through the frags calling cvt_frag_to_fill, switch to
+ SEG_DATA when we reach data_frag_root.
+
Tue Jun 10 17:08:34 1997 Jeffrey A Law (law@cygnus.com)
* config/tc-mn10300.c (md_assemble): Allow an empty register
diff --git a/gas/write.c b/gas/write.c
index 77960f0..71b5fec 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1460,6 +1460,13 @@ write_object_file ()
for (fragP = text_frag_root; fragP; fragP = fragP->fr_next)
{
+ /* At this point we have linked all the frags into a single
+ chain. However, cvt_frag_to_fill may call md_convert_frag
+ which may call fix_new. We need to ensure that fix_new adds
+ the fixup to the right section. */
+ if (fragP == data_frag_root)
+ subseg_change (SEG_DATA, 0);
+
cvt_frag_to_fill (&headers, SEG_TEXT, fragP);
/* Some assert macros don't work with # directives mixed in. */
@@ -1886,7 +1893,6 @@ write_object_file ()
#ifdef TC_GENERIC_RELAX_TABLE
static int is_dnrange PARAMS ((fragS *, fragS *));
-static long relax_frag PARAMS ((fragS *, long));
/* Subroutines of relax_segment. */
static int
@@ -1902,7 +1908,7 @@ is_dnrange (f1, f2)
/* Relax a fragment by scanning TC_GENERIC_RELAX_TABLE. */
-static long
+long
relax_frag (fragP, stretch)
fragS *fragP;
long stretch;