From 94b41882b09a0b61c27cb0220ac31d9f5496e13c Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 4 Oct 2016 10:43:50 +1030 Subject: ld expression section Changes the result of ld expressions that were previously plain numbers to be an absolute address, in the same circumstances where numbers are treated as absolute addresses. * ld.texinfo (Expression Section): Update result of arithmetic expressions. * ldexp.c (arith_result_section): New function. (fold_binary): Use it. --- ld/ld.texinfo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ld/ld.texinfo') diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 1303a0e..6528b6a 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -6032,7 +6032,9 @@ The result of comparisons, @samp{&&} and @samp{||} is also a number. @item The result of other binary arithmetic and logical operations on two relative addresses in the same section or two absolute addresses -(after above conversions) is also a number. +(after above conversions) is also a number when +@code{LD_FEATURE ("SANE_EXPR")} or inside an output section definition +but an absolute address otherwise. @item The result of other operations on relative addresses or one relative address and a number, is a relative address in the same -- cgit v1.1