GNU Binutils with patches for OS216
修訂 | b3b9f8d3e99cf46c2f85445cc5189db4c4f47407 (tree) |
---|---|
時間 | 2018-01-12 02:33:20 |
作者 | Andrew Burgess <andrew.burgess@embe...> |
Commiter | Andrew Burgess |
ld: In map file use '=' in PROVIDE statements
Currently when recording a PROVIDE statement in a linker map file we
display something like:
However, in a linker script we write these statements like this:
This commit changes the output in the map file to be closer to linker
script format, the map file now contains:
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.
@@ -1,3 +1,10 @@ | ||
1 | +2018-01-11 Andrew Burgess <andrew.burgess@embecosm.com> | |
2 | + | |
3 | + * ldexp.c (exp_print_tree): Use '=' instead of ',' when printing | |
4 | + PROVIDE statements. | |
5 | + * testsuite/ld-scripts/provide-4.map: Update expected output. | |
6 | + * testsuite/ld-scripts/provide-5.map: Likewise. | |
7 | + | |
1 | 8 | 2018-01-11 H.J. Lu <hongjiu.lu@intel.com> |
2 | 9 | |
3 | 10 | PR ld/22696 |
@@ -1423,7 +1423,7 @@ exp_print_tree (etree_type *tree) | ||
1423 | 1423 | break; |
1424 | 1424 | case etree_provide: |
1425 | 1425 | case etree_provided: |
1426 | - fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst); | |
1426 | + fprintf (config.map_file, "PROVIDE (%s = ", tree->assign.dst); | |
1427 | 1427 | exp_print_tree (tree->assign.src); |
1428 | 1428 | fputc (')', config.map_file); |
1429 | 1429 | break; |
@@ -1,13 +1,13 @@ | ||
1 | 1 | #... |
2 | 2 | Linker script and memory map |
3 | 3 | #... |
4 | - \[!provide\] +PROVIDE \(foo, 0x1\) | |
5 | - \[!provide\] +PROVIDE \(bar, 0x2\) | |
6 | - 0x0+3 +PROVIDE \(baz, 0x3\) | |
4 | + \[!provide\] +PROVIDE \(foo = 0x1\) | |
5 | + \[!provide\] +PROVIDE \(bar = 0x2\) | |
6 | + 0x0+3 +PROVIDE \(baz = 0x3\) | |
7 | 7 | #... |
8 | 8 | 0x0+2000 +foo |
9 | - \[!provide\] +PROVIDE \(loc1, ALIGN \(\., 0x10\)\) | |
10 | - 0x0+2010 +PROVIDE \(loc2, ALIGN \(\., 0x10\)\) | |
11 | - \[!provide\] +PROVIDE \(loc3, \(loc1 \+ 0x20\)\) | |
9 | + \[!provide\] +PROVIDE \(loc1 = ALIGN \(\., 0x10\)\) | |
10 | + 0x0+2010 +PROVIDE \(loc2 = ALIGN \(\., 0x10\)\) | |
11 | + \[!provide\] +PROVIDE \(loc3 = \(loc1 \+ 0x20\)\) | |
12 | 12 | 0x0+2030 +loc4 = \(loc2 \+ 0x20\) |
13 | 13 | #... |
@@ -2,5 +2,5 @@ | ||
2 | 2 | Linker script and memory map |
3 | 3 | #... |
4 | 4 | 0x0+10 +foo = 0x10 |
5 | - \[!provide\] +PROVIDE \(foo, bar\) | |
5 | + \[!provide\] +PROVIDE \(foo = bar\) | |
6 | 6 | #... |