This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] xtensa: ld: restore old section sorting behavior
- From: Max Filippov <jcmvbkbc at gmail dot com>
- To: binutils at sourceware dot org
- Cc: Sterling Augustine <augustine dot sterling at gmail dot com>, David Weatherford <weath at cadence dot com>, linux-xtensa at linux-xtensa dot org, Max Filippov <jcmvbkbc at gmail dot com>
- Date: Wed, 2 Aug 2017 03:11:04 -0700
- Subject: [PATCH] xtensa: ld: restore old section sorting behavior
- Authentication-results: sourceware.org; auth=none
With the recent change 535b785fb0c9 ("Don't compare boolean values
against TRUE or FALSE") the following assertion is observed when
linking with --sort-section,alignment option:
BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965
It appears that xtensa linker only supported sorting sections by name,
and the code that checks for the section sorting type in
ld/emultempl/xtensaelf.em was not updated in the change bcaa7b3eb957
("ld/"), that replaced boolean wildcard_spec::sorted with enumeration.
Restore the original behavior of the section sorting code.
ld/
2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
* emultempl/xtensaelf.em
(xtensa_wild_group_interleave_callback): Only check for by_name
sorting.
---
ld/emultempl/xtensaelf.em | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
index 1447d526a25b..3827d91b6291 100644
--- a/ld/emultempl/xtensaelf.em
+++ b/ld/emultempl/xtensaelf.em
@@ -1432,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement)
struct wildcard_list *l;
for (l = w->section_list; l != NULL; l = l->next)
{
- if (l->spec.sorted != none)
+ if (l->spec.sorted == by_name)
{
no_reorder = TRUE;
break;
--
2.1.4