0001-Relax-assertion-in-BFIN-linker-to-allow-for-discard-.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From ed3056ebdb9795446157af03d3e08fbb93c1b01d Mon Sep 17 00:00:00 2001
  2. From: Nick Clifton <nickc@redhat.com>
  3. Date: Tue, 29 Mar 2016 10:24:16 +0100
  4. Subject: [PATCH] Relax assertion in BFIN linker to allow for discard GOT
  5. relocs.
  6. PR 17334
  7. * elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
  8. assertion on the size of the got section to allow it to be bigger
  9. than the number of relocs.
  10. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  11. ---
  12. bfd/elf32-bfin.c | 8 +++++++-
  13. 2 files changed, 14 insertions(+), 1 deletion(-)
  14. diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
  15. index 7cc8b6d851e..b2fcf38b470 100644
  16. --- a/bfd/elf32-bfin.c
  17. +++ b/bfd/elf32-bfin.c
  18. @@ -4457,7 +4457,13 @@ elf32_bfinfdpic_finish_dynamic_sections (bfd *output_bfd,
  19. if (bfinfdpic_got_section (info))
  20. {
  21. BFD_ASSERT (bfinfdpic_gotrel_section (info)->size
  22. - == (bfinfdpic_gotrel_section (info)->reloc_count
  23. + /* PR 17334: It appears that the GOT section can end up
  24. + being bigger than the number of relocs. Presumably
  25. + because some relocs have been deleted. A test case has
  26. + yet to be generated for verify this, but in the meantime
  27. + the test below has been changed from == to >= so that
  28. + applications can continue to be built. */
  29. + >= (bfinfdpic_gotrel_section (info)->reloc_count
  30. * sizeof (Elf32_External_Rel)));
  31. if (bfinfdpic_gotfixup_section (info))
  32. --
  33. 2.39.5