This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: finalize_syms for non-bfd
On Sat, May 26, 2001 at 07:53:15PM +0200, Peter Jakubek wrote:
>
> The mri variant works now, with and without listing:
>
> This should be the equivalent code using the alternative syntax:
>
> .mri 0
> .text
> x1: .space 2
> .set x1l,.-x1
> x2: .space 4
> .set x2l,.-x2
> x3: .space x1l
> .space x2l
> .space 4
> .set x3l,.-x3
> x4: .space x1l
> .space 4
> .set x4l,.-x4
> s1: .space 4
> .set s1l,.-s1
> s2: .space 4
> .space s1l
> .set s2l,.-s2
> s3: .space 4
> .space s1l
> .space s2l
> .set s3l,.-s3
>
> This seems to assemble as long as I do *not* enable listings.
> With the -a option this produces error messages:
>
> error5g.s:7: Error: .space specifies non-absolute value
> error5g.s:8: Error: .space specifies non-absolute value
> error5g.s:11: Error: .space specifies non-absolute value
> error5g.s:17: Error: .space specifies non-absolute value
> error5g.s:20: Error: .space specifies non-absolute value
> error5g.s:21: Error: .space specifies non-absolute value
>
> How come?
gas/read.c:2776 messes up gas/write.c:2462. I think this patch will
work now that resolve_symbol_value sets the symbol segment even when
not fully resolving.
gas/ChangeLog
* write.c (relax_segment <rs_space>): Check the section of a
symbol to determine whether it is absolute rather than comparing
its frag against zero_address_frag as listings play tricks with
frags.
--
Alan Modra
Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.36
diff -u -p -r1.36 write.c
--- write.c 2001/05/26 12:45:15 1.36
+++ write.c 2001/05/27 11:38:19
@@ -2459,7 +2459,7 @@ relax_segment (segment_frag_root, segmen
offsetT amount;
amount = S_GET_VALUE (symbolP);
- if (symbol_get_frag (symbolP) != &zero_address_frag
+ if (S_GET_SEGMENT (symbolP) != absolute_section
|| S_IS_COMMON (symbolP)
|| ! S_IS_DEFINED (symbolP))
{