0005-arm.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. diff -Nur elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c
  2. --- elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c 2021-02-08 14:02:15.000000000 +0100
  3. +++ elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c 2021-04-09 20:40:19.386179197 +0200
  4. @@ -424,7 +424,8 @@
  5. */
  6. if ((!pic_with_got || ALWAYS_RELOC_TEXT) &&
  7. ((a->flags & SEC_CODE) ||
  8. - ((a->flags & (SEC_DATA | SEC_READONLY)) == (SEC_DATA | SEC_READONLY))))
  9. + ((a->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) ==
  10. + (SEC_DATA | SEC_READONLY | SEC_RELOC))))
  11. sectionp = text + (a->vma - text_vma);
  12. else if (a->flags & SEC_DATA)
  13. sectionp = data + (a->vma - data_vma);
  14. @@ -1861,7 +1862,9 @@
  15. bfd_size_type sec_size;
  16. bfd_vma sec_vma;
  17. - if (s->flags & SEC_CODE) {
  18. + if ((s->flags & SEC_CODE) ||
  19. + ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) ==
  20. + (SEC_DATA | SEC_READONLY | SEC_RELOC))) {
  21. vma = &text_vma;
  22. len = &text_len;
  23. } else if (s->flags & SEC_DATA) {
  24. @@ -1896,7 +1899,9 @@
  25. /* Read in all text sections. */
  26. for (s = abs_bfd->sections; s != NULL; s = s->next)
  27. - if (s->flags & SEC_CODE)
  28. + if ((s->flags & SEC_CODE) ||
  29. + ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) ==
  30. + (SEC_DATA | SEC_READONLY | SEC_RELOC)))
  31. if (!bfd_get_section_contents(abs_bfd, s,
  32. text + (s->vma - text_vma), 0,
  33. bfd_section_size(abs_bfd, s)))
  34. @@ -1922,7 +1927,9 @@
  35. /* Read in all data sections. */
  36. for (s = abs_bfd->sections; s != NULL; s = s->next)
  37. - if (s->flags & SEC_DATA)
  38. + if ((s->flags & SEC_DATA) &&
  39. + ((s->flags & (SEC_READONLY | SEC_RELOC)) !=
  40. + (SEC_READONLY | SEC_RELOC)))
  41. if (!bfd_get_section_contents(abs_bfd, s,
  42. data + (s->vma - data_vma), 0,
  43. bfd_section_size(abs_bfd, s)))