From 057de2b771709291308b7c2217707a35fdf54c9f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 9 Apr 2021 21:33:51 +0200 Subject: stm32 fixes --- .../0005-arm.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch (limited to 'toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch') diff --git a/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch b/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch new file mode 100644 index 000000000..247ff2b35 --- /dev/null +++ b/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch @@ -0,0 +1,46 @@ +diff -Nur elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c +--- elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c 2021-02-08 14:02:15.000000000 +0100 ++++ elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c 2021-04-09 20:40:19.386179197 +0200 +@@ -424,7 +424,8 @@ + */ + if ((!pic_with_got || ALWAYS_RELOC_TEXT) && + ((a->flags & SEC_CODE) || +- ((a->flags & (SEC_DATA | SEC_READONLY)) == (SEC_DATA | SEC_READONLY)))) ++ ((a->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC)))) + sectionp = text + (a->vma - text_vma); + else if (a->flags & SEC_DATA) + sectionp = data + (a->vma - data_vma); +@@ -1861,7 +1862,9 @@ + bfd_size_type sec_size; + bfd_vma sec_vma; + +- if (s->flags & SEC_CODE) { ++ if ((s->flags & SEC_CODE) || ++ ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC))) { + vma = &text_vma; + len = &text_len; + } else if (s->flags & SEC_DATA) { +@@ -1896,7 +1899,9 @@ + + /* Read in all text sections. */ + for (s = abs_bfd->sections; s != NULL; s = s->next) +- if (s->flags & SEC_CODE) ++ if ((s->flags & SEC_CODE) || ++ ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC))) + if (!bfd_get_section_contents(abs_bfd, s, + text + (s->vma - text_vma), 0, + bfd_section_size(abs_bfd, s))) +@@ -1922,7 +1927,9 @@ + + /* Read in all data sections. */ + for (s = abs_bfd->sections; s != NULL; s = s->next) +- if (s->flags & SEC_DATA) ++ if ((s->flags & SEC_DATA) && ++ ((s->flags & (SEC_READONLY | SEC_RELOC)) != ++ (SEC_READONLY | SEC_RELOC))) + if (!bfd_get_section_contents(abs_bfd, s, + data + (s->vma - data_vma), 0, + bfd_section_size(abs_bfd, s))) -- cgit v1.2.3