This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Fix handling of common symbols with plugins
- From: Cary Coutant <ccoutant at google dot com>
- To: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Wed, 17 Sep 2014 15:46:36 -0700
- Subject: Re: [patch] Fix handling of common symbols with plugins
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jRe+9-c3erPGakOydZfpEZAD5Fw=bEP1EV7MyFFp33wApQQ at mail dot gmail dot com> <CAHACq4oaSAUUpn08eFfN488kSa8J9pkKxTEQgzKR5Z8KbbWMkQ at mail dot gmail dot com> <CAMe9rOqKLp-T2SUgMU3x2j22f-AtG7z1H9nvQoNB36SHbCEhvA at mail dot gmail dot com> <CAG3jReKk0XOEKzSo598NugCHn2A3GygKBc4ZCi7hodg6NEJnDw at mail dot gmail dot com>
> Thanks for mentioning tests. I decided to try to write one for gold. I
> managed to write one that passes now but fails with my patch reverted,
> but it uses readelf to check the alignment of .bss, is that OK?
+# plugin_test_6.sh -- a test case for the plugin API.
+
+# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+# Written by Cary Coutant <ccoutant@google.com>.
Update these lines.
+readelf -SW plugin_test_10 > plugin_test_10.sections
+grep ".bss.* 8$" plugin_test_10.sections > /dev/null
+
+exit 0
The readelf command should be run from the Makefile itself. Create a
new rule for plugin_test_10.sections, and use $(TEST_READELF). There
are several examples of this in testsuite/Makefile.am.
Then your test script only needs to run grep, but use grep's "-q"
option instead of "> /dev/null".
-cary