From 8f4ae1a6334fec17bdffa94e61b92630c6d9158c Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 19 Jul 2017 00:33:03 -0300 Subject: [PATCH] LVU: move leb128 undefined check to cvt_frag_to_fill --- gas/write.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gas/write.c b/gas/write.c index b551afcb1ca..8efdbc506f4 100644 --- a/gas/write.c +++ b/gas/write.c @@ -465,6 +465,13 @@ cvt_frag_to_fill (segT sec ATTRIBUTE_UNUSED, fragS *fragP) valueT value = S_GET_VALUE (fragP->fr_symbol); int size; + if (!S_IS_DEFINED (fragP->fr_symbol)) + { + as_bad_where (fragP->fr_file, fragP->fr_line, + _("leb128 operand is an undefined symbol: %s"), + S_GET_NAME (fragP->fr_symbol)); + } + size = output_leb128 (fragP->fr_literal + fragP->fr_fix, value, fragP->fr_subtype); @@ -2451,13 +2458,6 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass) #endif case rs_leb128: - if (pass == 0 && !S_IS_DEFINED (fragP->fr_symbol)) - { - as_bad_where (fragP->fr_file, fragP->fr_line, - _("leb128 operand is an undefined symbol: %s"), - S_GET_NAME (fragP->fr_symbol)); - } - /* Initial guess is always 1; doing otherwise can result in stable solutions that are larger than the minimum. */ address += fragP->fr_offset = 1; -- 2.47.2