xtensa-ld-restore-old-section-sorting-behavior.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 3a399127ead1ba3c8b8d0b9e7206fce39311ee72 Mon Sep 17 00:00:00 2001
  2. From: Max Filippov <jcmvbkbc@gmail.com>
  3. Date: Wed, 2 Aug 2017 02:49:56 -0700
  4. Subject: [PATCH] xtensa: ld: restore old section sorting behavior
  5. With the recent change 535b785fb0c9 ("Don't compare boolean values
  6. against TRUE or FALSE") the following assertion is observed when
  7. linking with --sort-section,alignment option:
  8. BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965
  9. It appears that xtensa linker only supported sorting sections by name,
  10. and the code that checks for the section sorting type in
  11. ld/emultempl/xtensaelf.em was not updated in the change bcaa7b3eb957
  12. ("ld/"), that replaced boolean wildcard_spec::sorted with enumeration.
  13. Restore the original behavior of the section sorting code.
  14. ld/
  15. 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
  16. * emultempl/xtensaelf.em
  17. (xtensa_wild_group_interleave_callback): Only check for by_name
  18. sorting.
  19. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  20. ---
  21. Backported from: 73d5923e480944e2d66bde8c59f4dff298ec57e3
  22. ld/emultempl/xtensaelf.em | 2 +-
  23. 1 file changed, 1 insertion(+), 1 deletion(-)
  24. diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
  25. index 1447d526a25b..3827d91b6291 100644
  26. --- a/ld/emultempl/xtensaelf.em
  27. +++ b/ld/emultempl/xtensaelf.em
  28. @@ -1432,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement)
  29. struct wildcard_list *l;
  30. for (l = w->section_list; l != NULL; l = l->next)
  31. {
  32. - if (l->spec.sorted != none)
  33. + if (l->spec.sorted == by_name)
  34. {
  35. no_reorder = TRUE;
  36. break;
  37. --
  38. 2.1.4