This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] Tweak keep_text_section_prefix test for PowerPC64 ELFv1
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Cary Coutant <ccoutant at gmail dot com>
- Date: Tue, 18 Dec 2018 11:01:26 +1030
- Subject: [GOLD] Tweak keep_text_section_prefix test for PowerPC64 ELFv1
This test checks code layout by function symbol ordering, but that
doesn't work on powerpc64 ELFv1 where the function symbol is on a
descriptor. A simple work-around is to have nm emit synthetic symbols
marking the code entry point of functions. Since the text segment is
laid out before the data segment, the synthetic symbols will have
lower addresses than function descriptor symbols and be seen first in
nm -n output.
On other targets, nm --synthetic typically emits symbols on plt
entries. Since the testcase doesn't call any of the functions of
interest there shouldn't be plt entries for those functions, so there
should be no potentially confusing extra symbols.
Tested powerpc64-linux and x86_64-linux. OK?
* testsuite/Makefile.am (keep_text_section_prefix_nm.stdout):
Pass --synthetic to nm.
* testsuite/Makefile.in: Regenerate.
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 135790b30d..e44cf6e4f9 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -388,7 +388,7 @@ keep_text_section_prefix: keep_text_section_prefix.o gcctestdir/ld
keep_text_section_prefix_readelf.stdout: keep_text_section_prefix
$(TEST_READELF) -Wl $< >$@
keep_text_section_prefix_nm.stdout: keep_text_section_prefix
- $(TEST_NM) -n $< >$@
+ $(TEST_NM) -n --synthetic $< >$@
check_PROGRAMS += icf_virtual_function_folding_test
MOSTLYCLEANFILES += icf_virtual_function_folding_test icf_virtual_function_folding_test.map
--
Alan Modra
Australia Development Lab, IBM