0004-Fix-powerpc-issue-with-the-linker-from-Fedora-32.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 5126732d73aa75a0bc84f898042bfe35640624b8 Mon Sep 17 00:00:00 2001
  2. From: Thomas Huth <thuth@redhat.com>
  3. Date: Wed, 13 May 2020 13:14:46 +0200
  4. Subject: [PATCH] Fix powerpc issue with the linker from Fedora 32
  5. The linker from Fedora 32 complains:
  6. powerpc64-linux-gnu-ld: powerpc/selftest.elf: error: PHDR segment not
  7. covered by LOAD segment
  8. Let's introduce some fake PHDRs to the linker script to get this
  9. working again.
  10. Message-Id: <20200514192626.9950-7-thuth@redhat.com>
  11. Signed-off-by: Thomas Huth <thuth@redhat.com>
  12. Signed-off-by: Matthew Weber <matthew.weber@collins.com>
  13. ---
  14. powerpc/flat.lds | 19 ++++++++++++++++---
  15. 1 file changed, 16 insertions(+), 3 deletions(-)
  16. diff --git a/powerpc/flat.lds b/powerpc/flat.lds
  17. index 53221e8..5eed368 100644
  18. --- a/powerpc/flat.lds
  19. +++ b/powerpc/flat.lds
  20. @@ -1,7 +1,17 @@
  21. +PHDRS
  22. +{
  23. + text PT_LOAD FLAGS(5);
  24. + data PT_LOAD FLAGS(6);
  25. +}
  26. +
  27. SECTIONS
  28. {
  29. - .text : { *(.init) *(.text) *(.text.*) }
  30. + .text : {
  31. + *(.init)
  32. + *(.text)
  33. + *(.text.*)
  34. + } :text
  35. . = ALIGN(64K);
  36. etext = .;
  37. .opd : { *(.opd) }
  38. @@ -19,9 +29,12 @@ SECTIONS
  39. .data : {
  40. *(.data)
  41. *(.data.rel*)
  42. - }
  43. + } :data
  44. . = ALIGN(16);
  45. - .rodata : { *(.rodata) *(.rodata.*) }
  46. + .rodata : {
  47. + *(.rodata)
  48. + *(.rodata.*)
  49. + } :data
  50. . = ALIGN(16);
  51. .bss : { *(.bss) }
  52. . = ALIGN(256);
  53. --
  54. 2.17.1