This is the mail archive of the
mailing list for the binutils project.
[PATCH 0/2] ld: PROVIDE, undefined symbols, and mapfiles.
- From: Andrew Burgess <andrew dot burgess at embecosm dot com>
- To: binutils at sourceware dot org
- Cc: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Wed, 7 Jan 2015 12:14:39 +0000
- Subject: [PATCH 0/2] ld: PROVIDE, undefined symbols, and mapfiles.
- Authentication-results: sourceware.org; auth=none
Consider the following snippet of linker script:
PROVIDE (foo = 0x10);
PROVIDE (bar = foo);
If both 'foo' and 'bar' are not needed then both of these PROVIDE
statements will have no effect.
However, when creating a linker mapfile, the expressions in both
PROVIDE statements are, currently, evaluated. This is fine for the
'foo' case, but in the 'bar' case the foo symbol is undefined, and so
we get a fatal, undefined symbol, error.
The first patch in this series adds a new option to run_dump_test
called 'map' that allows for easier testing of generated linker scripts.
The second patch resolves the above problem by not evaluating the
PROVIDE expression when the symbol being provided is not needed.
Andrew Burgess (2):
ld/testing: run_dump_test can now check linker mapfiles.
ld: Don't evaluate unneeded PROVIDE expressions.
ld/ChangeLog | 7 +++++++
ld/ldlang.c | 14 +++++++++++--
ld/testsuite/ChangeLog | 14 +++++++++++++
ld/testsuite/ld-scripts/overlay-size.d | 1 +
ld/testsuite/ld-scripts/overlay-size.exp | 9 ---------
ld/testsuite/ld-scripts/provide-4-map.d | 26 ++++++++++++++++++++++++
ld/testsuite/ld-scripts/provide-4.d | 10 ++++++++++
ld/testsuite/ld-scripts/provide-4.t | 16 +++++++++++++++
ld/testsuite/ld-scripts/provide.exp | 1 +
ld/testsuite/lib/ld-lib.exp | 34 ++++++++++++++++++++++++++++++++
10 files changed, 121 insertions(+), 11 deletions(-)
create mode 100644 ld/testsuite/ld-scripts/provide-4-map.d
create mode 100644 ld/testsuite/ld-scripts/provide-4.d
create mode 100644 ld/testsuite/ld-scripts/provide-4.t