From a1438fce30be2e62cfcb2d798e46766c65b82316 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 31 Aug 2007 14:46:55 +0000 Subject: [PATCH] * ldlang.c (lang_map): Increment lang_statement_iteration so that DEFINED() expressions are correctly computed. * testsuite/ld-script/map-address.d, * testsuite/ld-script/map-address.t: Add a test for testing DEFINED in map output. --- ld/ChangeLog | 5 +++++ ld/ldlang.c | 3 ++- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-scripts/map-address.d | 2 ++ ld/testsuite/ld-scripts/map-address.t | 2 ++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 8a94b2e..1579bec 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2007-08-31 Tristan Gingold + + * ldlang.c (lang_map): Increment lang_statement_iteration so that + DEFINED() expressions are correctly computed. + 2007-08-31 Alan Modra * ldlang.c (lang_record_phdrs): Give a fatal error if no sections diff --git a/ld/ldlang.c b/ld/ldlang.c index f247a17..7ecd477 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -1811,6 +1811,7 @@ lang_map (void) bfd_map_over_sections (p, init_map_userdata, 0); bfd_link_hash_traverse (link_info.hash, sort_def_symbol, 0); } + lang_statement_iteration ++; print_statements (); } @@ -3539,7 +3540,7 @@ print_assignment (lang_assignment_statement_type *assignment, value = h->u.def.value; if (expld.result.section) - value += expld.result.section->vma; + value += expld.result.section->vma; minfo ("[0x%V]", value); } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index ec3cf04..5b0ce32 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-08-31 Tristan Gingold + + * ld-script/map-address.t: Add a test for testing DEFINED in map + output. + * ld-script/map-address.d: Update expected output. + 2007-08-28 Mark Shinwell Joseph Myers diff --git a/ld/testsuite/ld-scripts/map-address.d b/ld/testsuite/ld-scripts/map-address.d index 289b685..7877ca4 100644 --- a/ld/testsuite/ld-scripts/map-address.d +++ b/ld/testsuite/ld-scripts/map-address.d @@ -1,6 +1,8 @@ #... Linker script and memory map #... + *0x0*000020 *def1 = .* + *0x0*000020 *def2 = def1 *0x0*010001 *\. = 0x10001 *0x0*010001 *foo = \. *0x0*010201 *\. = \(\. \+ 0x200\) diff --git a/ld/testsuite/ld-scripts/map-address.t b/ld/testsuite/ld-scripts/map-address.t index 8f2dfeb..e077ed1 100644 --- a/ld/testsuite/ld-scripts/map-address.t +++ b/ld/testsuite/ld-scripts/map-address.t @@ -1,5 +1,7 @@ SECTIONS { + def1 = DEFINED(foo) ? 0x10 : 0x20; + def2 = def1; . = 0x10001; foo = .; . += 0x200; -- 2.7.4