public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: binutils@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 1/4] ld: In map file use '=' in PROVIDE statements
Date: Tue, 09 Jan 2018 21:09:00 -0000	[thread overview]
Message-ID: <b7946e4f45d9943401d03206af8c8be7f8b34b3c.1515531328.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1515531328.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1515531328.git.andrew.burgess@embecosm.com>

Currently when recording a PROVIDE statement in a linker script we
display something like:

    PROVIDE (SYMBOL, VALUE)

However, in linker scripts we write these statements like this:

    PROVIDE (SYMBOL = VALUE);

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

    PROVIDE (SYMBOL = VALUE)

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                            |  7 +++++++
 ld/ldexp.c                              |  2 +-
 ld/testsuite/ld-scripts/provide-4-map.d | 12 ++++++------
 ld/testsuite/ld-scripts/provide-5-map.d |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/ld/ldexp.c b/ld/ldexp.c
index 9fbc892e4b5..800c7f80859 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -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;
diff --git a/ld/testsuite/ld-scripts/provide-4-map.d b/ld/testsuite/ld-scripts/provide-4-map.d
index 189d1d04bcc..6ef936c8592 100644
--- a/ld/testsuite/ld-scripts/provide-4-map.d
+++ b/ld/testsuite/ld-scripts/provide-4-map.d
@@ -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\)
 #...
diff --git a/ld/testsuite/ld-scripts/provide-5-map.d b/ld/testsuite/ld-scripts/provide-5-map.d
index a75e4aa73c5..78b0bcbbdd3 100644
--- a/ld/testsuite/ld-scripts/provide-5-map.d
+++ b/ld/testsuite/ld-scripts/provide-5-map.d
@@ -2,5 +2,5 @@
 Linker script and memory map
 #...
                 0x0+10 +foo = 0x10
-                \[!provide\] +PROVIDE \(foo, bar\)
+                \[!provide\] +PROVIDE \(foo = bar\)
 #...
-- 
2.14.3

  parent reply	other threads:[~2018-01-09 21:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 21:09 [PATCH 0/4] Fix issue with PROVIDE in linker scripts Andrew Burgess
2018-01-09 21:09 ` [PATCH 4/4] ld: Remove unused expression state Andrew Burgess
2018-01-10  6:50   ` Alan Modra
2018-01-09 21:09 ` [PATCH 2/4] ld: Find and run some tests using a wildcard pattern Andrew Burgess
2018-01-10  6:47   ` Alan Modra
2018-01-09 21:09 ` Andrew Burgess [this message]
2018-01-10  6:45   ` [PATCH 1/4] ld: In map file use '=' in PROVIDE statements Alan Modra
2018-01-09 21:09 ` [PATCH 3/4] ld: Fix issue where PROVIDE overrides defined symbol Andrew Burgess
2018-01-10  6:50   ` Alan Modra
2018-01-11 17:42 ` [PATCH 0/4] Fix issue with PROVIDE in linker scripts Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7946e4f45d9943401d03206af8c8be7f8b34b3c.1515531328.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).