* [binutils-gdb] gas: allow frag address wrapping in absolute section
@ 2023-03-09 12:18 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-03-09 12:18 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2dc2dfa7d7a53aae58da4a51a77e9ad996cd2937
commit 2dc2dfa7d7a53aae58da4a51a77e9ad996cd2937
Author: Alan Modra <amodra@gmail.com>
Date: Thu Mar 9 16:35:12 2023 +1030
gas: allow frag address wrapping in absolute section
This:
.struct -1
x:
.fill 1
y:
results in an internal error in frag_new due to abs_section_offset
wrapping from -1 to 0. Frags in the absolute section don't do much so
I think we can allow the address wrap.
* frags.c (frag_new): Allow address wrap in absolute section.
Diff:
---
gas/frags.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gas/frags.c b/gas/frags.c
index 2a2806da835..016d857ded6 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -166,7 +166,8 @@ frag_new (size_t old_frags_var_max_size
/* Fix up old frag's fr_fix. */
frag_now->fr_fix = frag_now_fix_octets ();
- gas_assert (frag_now->fr_fix >= old_frags_var_max_size);
+ gas_assert (frag_now->fr_fix >= old_frags_var_max_size
+ || now_seg == absolute_section);
frag_now->fr_fix -= old_frags_var_max_size;
/* Make sure its type is valid. */
gas_assert (frag_now->fr_type != 0);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-09 12:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 12:18 [binutils-gdb] gas: allow frag address wrapping in absolute section Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).