ld: In map file use '=' in PROVIDE statements
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 5 Jan 2018 22:41:55 +0000 (22:41 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 11 Jan 2018 17:33:20 +0000 (17:33 +0000)
Currently when recording a PROVIDE statement in a linker map file we
display something like:

    PROVIDE (SYMBOL, VALUE)

However, in a linker script we write these statements like this:

    PROVIDE (SYMBOL = VALUE);

This commit changes the output in the map file to be closer to linker
script format, the map file now contains:

    PROVIDE (SYMBOL = VALUE)

The ';' is still missing from the end, but map files are not intended
to be valid linker script input, so adding the ';' just seems like
clutter.

ld/ChangeLog:

* ldexp.c (exp_print_tree): Use '=' instead of ',' when printing
PROVIDE statements.
* testsuite/ld-scripts/provide-4.map: Update expected output.
* testsuite/ld-scripts/provide-5.map: Likewise.

ld/ChangeLog
ld/ldexp.c
ld/testsuite/ld-scripts/provide-4-map.d
ld/testsuite/ld-scripts/provide-5-map.d

index c5085b179b9519574d5b28705fb173a9f11db34e..1357b89175b8f94cbcbabda969b20351c3596a06 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-11  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * ldexp.c (exp_print_tree): Use '=' instead of ',' when printing
+       PROVIDE statements.
+       * testsuite/ld-scripts/provide-4.map: Update expected output.
+       * testsuite/ld-scripts/provide-5.map: Likewise.
+
 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/22696
index 9fbc892e4b59a1d6fb12be930d7f43a2f2f14c5e..800c7f80859ff85fddd88200690eb3ecd7363d99 100644 (file)
@@ -1423,7 +1423,7 @@ exp_print_tree (etree_type *tree)
       break;
     case etree_provide:
     case etree_provided:
-      fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst);
+      fprintf (config.map_file, "PROVIDE (%s = ", tree->assign.dst);
       exp_print_tree (tree->assign.src);
       fputc (')', config.map_file);
       break;
index 189d1d04bcce69c2b30d7b55560a155335110518..6ef936c859289f163e7cd74e808c6508239f0125 100644 (file)
@@ -1,13 +1,13 @@
 #...
 Linker script and memory map
 #...
-                \[!provide\] +PROVIDE \(foo, 0x1\)
-                \[!provide\] +PROVIDE \(bar, 0x2\)
-                0x0+3 +PROVIDE \(baz, 0x3\)
+                \[!provide\] +PROVIDE \(foo = 0x1\)
+                \[!provide\] +PROVIDE \(bar = 0x2\)
+                0x0+3 +PROVIDE \(baz = 0x3\)
 #...
                 0x0+2000 +foo
-                \[!provide\] +PROVIDE \(loc1, ALIGN \(\., 0x10\)\)
-                0x0+2010 +PROVIDE \(loc2, ALIGN \(\., 0x10\)\)
-                \[!provide\] +PROVIDE \(loc3, \(loc1 \+ 0x20\)\)
+                \[!provide\] +PROVIDE \(loc1 = ALIGN \(\., 0x10\)\)
+                0x0+2010 +PROVIDE \(loc2 = ALIGN \(\., 0x10\)\)
+                \[!provide\] +PROVIDE \(loc3 = \(loc1 \+ 0x20\)\)
                 0x0+2030 +loc4 = \(loc2 \+ 0x20\)
 #...
index a75e4aa73c5a48eda2d858d7aa24c218a53761b7..78b0bcbbdd31caf81dbbdd44d88dac593da6b07b 100644 (file)
@@ -2,5 +2,5 @@
 Linker script and memory map
 #...
                 0x0+10 +foo = 0x10
-                \[!provide\] +PROVIDE \(foo, bar\)
+                \[!provide\] +PROVIDE \(foo = bar\)
 #...