summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-05-07 14:30:41 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-05-07 14:30:41 +0000
commit647f9771e2d1a179888f51c166eb0e7e8d933861 (patch)
tree2a653f006df38db755e7a02174152cca4d8be8ac
parent961f5c65177183065d27cfd829f4a117b875c3dd (diff)
downloadbinutils-redhat-647f9771e2d1a179888f51c166eb0e7e8d933861.tar.gz
* ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K. Correct
MAX_K. (fold_binary <SEGMENT_START>): Set expld.result.section to current section. Expand comment. Formatting. (fold_name <DEFINED>): Set expld.result.section to current section.
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/ldexp.c19
2 files changed, 20 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 16c21695f6..0873961138 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K. Correct
+ MAX_K.
+ (fold_binary <SEGMENT_START>): Set expld.result.section to
+ current section. Expand comment. Formatting.
+ (fold_name <DEFINED>): Set expld.result.section to current section.
+
2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
* ldlang.c (lang_size_sections_1): Don't check LMA overflow on
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 17dd49dd8c..3c6ad0c350 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -103,7 +103,10 @@ exp_print_token (token_code_type code, int infix_p)
{ ADDR, "ADDR" },
{ LOADADDR, "LOADADDR" },
{ CONSTANT, "CONSTANT" },
- { MAX_K, "MAX_K" },
+ { ABSOLUTE, "ABSOLUTE" },
+ { MAX_K, "MAX" },
+ { MIN_K, "MIN" },
+ { ASSERT_K, "ASSERT" },
{ REL, "relocatable" },
{ DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" },
{ DATA_SEGMENT_RELRO_END, "DATA_SEGMENT_RELRO_END" },
@@ -282,7 +285,9 @@ fold_binary (etree_type *tree)
exp_fold_tree_1 (tree->binary.lhs);
/* The SEGMENT_START operator is special because its first
- operand is a string, not the name of a symbol. */
+ operand is a string, not the name of a symbol. Note that the
+ operands have been swapped, so binary.lhs is second (default)
+ operand, binary.rhs is first operand. */
if (expld.result.valid_p && tree->type.node_code == SEGMENT_START)
{
const char *segment_name;
@@ -296,7 +301,7 @@ fold_binary (etree_type *tree)
seg->used = TRUE;
expld.result.value = seg->value;
expld.result.str = NULL;
- expld.result.section = NULL;
+ expld.result.section = expld.section;
break;
}
}
@@ -321,9 +326,9 @@ fold_binary (etree_type *tree)
return;
}
else if (expld.section != bfd_abs_section_ptr
- && expld.result.section == bfd_abs_section_ptr
- && (tree->type.node_code == '+'
- || tree->type.node_code == '-'))
+ && expld.result.section == bfd_abs_section_ptr
+ && (tree->type.node_code == '+'
+ || tree->type.node_code == '-'))
{
/* Keep the section of the lhs term. */
expld.result.section = lhs.section;
@@ -513,7 +518,7 @@ fold_name (etree_type *tree)
|| h->type == bfd_link_hash_common)
&& (def_iteration == lang_statement_iteration
|| def_iteration == -1));
- expld.result.section = bfd_abs_section_ptr;
+ expld.result.section = expld.section;
expld.result.valid_p = TRUE;
}
break;