Re: [PATCH 2/5] testsuites/libtests: Remove floats from libdl tests

2023-08-27 Thread Chris Johns
On 28/8/2023 2:12 pm, Alex White wrote:
> On Sun, Aug 27, 2023 at 8:38 PM Chris Johns  wrote:
>> The floats need to stay to make sure there are no issues with this type. I 
>> see
>> the tests with floats as valid.
>>
>> Is the only missing function `__extendsfdf2`?
> 
> Yes, that is the only missing function. If I change the floats to doubles, the
> need for `__extendsfdf2` goes away and the tests pass. Is that an acceptable
> solution?

I would happy with doubles being added so they are tested as well but that is
also outside the scope of your effort :)

Is it easier to add a Microblaze conditional for the use of a double to the base
image and to forced the symbol to be linked in?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 2/5] testsuites/libtests: Remove floats from libdl tests

2023-08-27 Thread Alex White
On Sun, Aug 27, 2023 at 8:38 PM Chris Johns  wrote:
> The floats need to stay to make sure there are no issues with this type. I see
> the tests with floats as valid.
>
> Is the only missing function `__extendsfdf2`?

Yes, that is the only missing function. If I change the floats to doubles, the
need for `__extendsfdf2` goes away and the tests pass. Is that an acceptable
solution?

Alex
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 2/2] cpukit/libdl: Fix incorrect operator precedence access the name

2023-08-27 Thread chrisj
From: Chris Johns 

Coverity Issue: CID 1442635 Out-of-bounds access
---
 cpukit/libdl/rtl-archive.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/libdl/rtl-archive.c b/cpukit/libdl/rtl-archive.c
index f916336f7c..4a6d2cbf0b 100644
--- a/cpukit/libdl/rtl-archive.c
+++ b/cpukit/libdl/rtl-archive.c
@@ -1174,6 +1174,7 @@ rtems_rtl_obj_archive_find_obj (int 
fd,
  */
 if (header[0] == '/')
 {
+  const char* name_ = *name;
   off_t extended_off;
 
   switch (header[1])
@@ -1190,7 +1191,7 @@ rtems_rtl_obj_archive_find_obj (int 
fd,
* return the result.
*/
   *extended_file_names = *ooffset + RTEMS_RTL_AR_FHDR_SIZE;
-  if (*name[0] == '/' && *name[1] == '/')
+  if (name_[0] == '/' && name_[1] == '/')
   {
 *ooffset = *ooffset + RTEMS_RTL_AR_FHDR_SIZE;
 return true;
-- 
2.37.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] cpukit/libdl: Correctly account for section alignments

2023-08-27 Thread chrisj
From: Chris Johns 

- Add the section alignment to the size as the allocator may not
  provide correctly aligned memory

- Only include symbols in the section when locating symbols. The
  powerpc was incorrectly adding SDATA BSS symbols to the BSS offset
  overrunning the section

Closes #4950
---
 cpukit/libdl/rtl-obj.c | 31 --
 testsuites/libtests/dl07/dl-load.c |  1 +
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/cpukit/libdl/rtl-obj.c b/cpukit/libdl/rtl-obj.c
index a35fbf9e8d..c99e9f703f 100644
--- a/cpukit/libdl/rtl-obj.c
+++ b/cpukit/libdl/rtl-obj.c
@@ -1032,6 +1032,7 @@ rtems_rtl_obj_sections_locate (uint32_tmask,
 {
   base_offset = rtems_rtl_obj_align (base_offset, sect->alignment);
   sect->base = base + base_offset;
+  base_offset += sect->size;
 }
 
 if (rtems_rtl_trace (RTEMS_RTL_TRACE_LOAD_SECT))
@@ -1040,9 +1041,6 @@ rtems_rtl_obj_sections_locate (uint32_tmask,
   order, sect->name, sect->base, sect->size,
   sect->flags, sect->alignment, sect->link);
 
-if (sect->base)
-  base_offset += sect->size;
-
 ++order;
 
 node = rtems_chain_first (sections);
@@ -1064,23 +1062,18 @@ rtems_rtl_obj_set_sizes (rtems_rtl_obj* obj)
   size_t data_size;
   size_t bss_size;
 
-  text_size  = rtems_rtl_obj_text_size (obj);
+  /*
+   * The allocator may not align memory to the required boundary. Add
+   * the alignment size to the size allocated.
+   */
+  text_size  = rtems_rtl_obj_text_size (obj) + rtems_rtl_obj_text_alignment 
(obj);
   tramp_size = rtems_rtl_obj_tramp_size (obj);
-
   if (tramp_size != 0)
-  {
-text_size += rtems_rtl_obj_tramp_alignment (obj);
-tramp_size += rtems_rtl_obj_const_alignment (obj);
-  }
-  else
-  {
-text_size += rtems_rtl_obj_const_alignment (obj);
-  }
-
-  const_size = rtems_rtl_obj_const_size (obj) + rtems_rtl_obj_eh_alignment 
(obj);
-  eh_size= rtems_rtl_obj_eh_size (obj) + rtems_rtl_obj_data_alignment 
(obj);
-  data_size  = rtems_rtl_obj_data_size (obj) + rtems_rtl_obj_bss_alignment 
(obj);
-  bss_size   = rtems_rtl_obj_bss_size (obj);
+tramp_size += rtems_rtl_obj_tramp_alignment (obj);
+  const_size = rtems_rtl_obj_const_size (obj) + rtems_rtl_obj_const_alignment 
(obj);
+  eh_size= rtems_rtl_obj_eh_size (obj) + rtems_rtl_obj_eh_alignment (obj);
+  data_size  = rtems_rtl_obj_data_size (obj) + rtems_rtl_obj_data_alignment 
(obj);
+  bss_size   = rtems_rtl_obj_bss_size (obj) + rtems_rtl_obj_bss_alignment 
(obj);
 
   /*
* Set the sizes held in the object data. We need this for a fast reference.
@@ -1098,7 +1091,7 @@ rtems_rtl_obj_set_sizes (rtems_rtl_obj* obj)
 static void
 rtems_rtl_obj_print_sizes (rtems_rtl_obj* obj, const char* label)
 {
-if (rtems_rtl_trace (RTEMS_RTL_TRACE_LOAD_SECT))
+  if (rtems_rtl_trace (RTEMS_RTL_TRACE_LOAD_SECT))
   {
 printf ("rtl: %s sect: text  - b:%p s:%zi a:%" PRIu32 "\n",
 label, obj->text_base, obj->text_size, 
rtems_rtl_obj_text_alignment (obj));
diff --git a/testsuites/libtests/dl07/dl-load.c 
b/testsuites/libtests/dl07/dl-load.c
index 58e3e06f78..2946120ca6 100644
--- a/testsuites/libtests/dl07/dl-load.c
+++ b/testsuites/libtests/dl07/dl-load.c
@@ -32,6 +32,7 @@
   RTEMS_RTL_TRACE_WARNING | \
   RTEMS_RTL_TRACE_LOAD | \
   RTEMS_RTL_TRACE_UNLOAD | \
+  RTEMS_RTL_TRACE_LOAD_SECT | \
   RTEMS_RTL_TRACE_SYMBOL | \
   RTEMS_RTL_TRACE_RELOC | \
   RTEMS_RTL_TRACE_ALLOCATOR | \
-- 
2.37.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 1/5] microblaze: Add libdl support

2023-08-27 Thread Chris Johns
On 28/8/2023 11:30 am, Alex White wrote:
> ---
>  cpukit/libdl/rtl-mdreloc-microblaze.c | 291 ++
>  cpukit/libdl/rtl-tls.c|   2 +-
>  .../microblaze/include/machine/elf_machdep.h  |  83 +
>  spec/build/cpukit/cpumicroblaze.yml   |   3 +
>  spec/build/cpukit/objdl.yml   |   2 +
>  spec/build/cpukit/objdlmicroblaze.yml |  15 +
>  spec/build/cpukit/optlibdl.yml|   1 +
>  7 files changed, 396 insertions(+), 1 deletion(-)
>  create mode 100644 cpukit/libdl/rtl-mdreloc-microblaze.c

There is an additional call in my changes to fix trampolines I have posted for
review. You will need to add that for the microblaze.

My trampoline fixes change the allocation order of the sections and that has
exposed an issue on powerpc that I am looking into. That issue will be a
separate patch.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 2/5] testsuites/libtests: Remove floats from libdl tests

2023-08-27 Thread Chris Johns
On 28/8/2023 11:30 am, Alex White wrote:
> This patch addresses an issue seen with MicroBlaze in the dl07, dl08,
> and dl09 tests by removing the use of floats. The issue relates to the
> fact that the MicroBlaze BSPs use software floating point routines. Any
> float passed to `printf` is converted to a double automatically because
> of default argument promotion with variadic functions. This conversion
> is handled by the `__extendsfdf2` libgcc function. The problem is that
> the main test executable does not use floating point code, so the
> `__extendsfdf2` function is not linked in. This causes a problem when
> loading the test objects.
> 
> This patch removes the use of floats so that BSPs that use software
> floating point routines can still run the tests.

The floats need to stay to make sure there are no issues with this type. I see
the tests with floats as valid.

Is the only missing function `__extendsfdf2`?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/5] testsuites/libtests: Remove floats from libdl tests

2023-08-27 Thread Alex White
This patch addresses an issue seen with MicroBlaze in the dl07, dl08,
and dl09 tests by removing the use of floats. The issue relates to the
fact that the MicroBlaze BSPs use software floating point routines. Any
float passed to `printf` is converted to a double automatically because
of default argument promotion with variadic functions. This conversion
is handled by the `__extendsfdf2` libgcc function. The problem is that
the main test executable does not use floating point code, so the
`__extendsfdf2` function is not linked in. This causes a problem when
loading the test objects.

This patch removes the use of floats so that BSPs that use software
floating point routines can still run the tests.
---
 testsuites/libtests/dl07/dl-o1.h   | 11 ---
 testsuites/libtests/dl07/dl-o2.h   |  8 +++-
 testsuites/libtests/dl07/dl-o4.h   |  1 -
 testsuites/libtests/dl07/dl07-o1.c | 16 +---
 testsuites/libtests/dl07/dl07-o2.c | 13 +++--
 testsuites/libtests/dl07/dl07-o3.c |  6 --
 testsuites/libtests/dl07/dl07-o4.c |  5 -
 testsuites/libtests/dl07/dl07-o5.c |  3 ---
 testsuites/libtests/dl08/dl-o1.h   | 11 ---
 testsuites/libtests/dl08/dl-o2.h   |  8 +++-
 testsuites/libtests/dl08/dl-o4.h   |  1 -
 testsuites/libtests/dl08/dl08-o1.c | 16 +---
 testsuites/libtests/dl08/dl08-o2.c | 10 +++---
 testsuites/libtests/dl08/dl08-o3.c |  1 -
 testsuites/libtests/dl08/dl08-o4.c |  2 --
 testsuites/libtests/dl09/dl-o1.h   | 11 ---
 testsuites/libtests/dl09/dl-o2.h   |  8 +++-
 testsuites/libtests/dl09/dl-o4.h   |  1 -
 testsuites/libtests/dl09/dl09-o1.c | 16 +---
 testsuites/libtests/dl09/dl09-o2.c | 10 +++---
 testsuites/libtests/dl09/dl09-o3.c |  1 -
 testsuites/libtests/dl09/dl09-o4.c |  2 --
 22 files changed, 45 insertions(+), 116 deletions(-)

diff --git a/testsuites/libtests/dl07/dl-o1.h b/testsuites/libtests/dl07/dl-o1.h
index 745e548778..74a9e4c935 100644
--- a/testsuites/libtests/dl07/dl-o1.h
+++ b/testsuites/libtests/dl07/dl-o1.h
@@ -29,13 +29,10 @@
 #if !defined(DL01_H)
 #define DL01_H
 
-extern int dl01_bss1;
-extern float   dl01_bss2[30];
-extern chardl01_bss3[10];
-extern int dl01_data1;
-extern float   dl01_data2;
-extern const int   dl01_const1;
-extern const float dl01_const2;
+extern int   dl01_bss1;
+extern char  dl01_bss3[10];
+extern int   dl01_data1;
+extern const int dl01_const1;
 int dl01_func1(void);
 
 #endif
diff --git a/testsuites/libtests/dl07/dl-o2.h b/testsuites/libtests/dl07/dl-o2.h
index d7812c4475..ac56921804 100644
--- a/testsuites/libtests/dl07/dl-o2.h
+++ b/testsuites/libtests/dl07/dl-o2.h
@@ -33,10 +33,8 @@
  * A set of variables in dl-o2 reference by dl-03.
  */
 
-extern int   dl02_bss1;
-extern float dl02_bss2[7];
-extern char  dl02_bss3[21];
-extern int   dl02_data1;
-extern float dl02_data2;
+extern int  dl02_bss1;
+extern char dl02_bss3[21];
+extern int  dl02_data1;
 
 #endif
diff --git a/testsuites/libtests/dl07/dl-o4.h b/testsuites/libtests/dl07/dl-o4.h
index 7ea5139fe9..c49223c23b 100644
--- a/testsuites/libtests/dl07/dl-o4.h
+++ b/testsuites/libtests/dl07/dl-o4.h
@@ -37,7 +37,6 @@
  */
 
 extern int dl04_unresolv_1;
-extern float   dl04_unresolv_2;
 extern chardl04_unresolv_3;
 extern char*   dl04_unresolv_4;
 extern const int   dl04_unresolv_5;
diff --git a/testsuites/libtests/dl07/dl07-o1.c 
b/testsuites/libtests/dl07/dl07-o1.c
index 24a8086c49..229bd582e7 100644
--- a/testsuites/libtests/dl07/dl07-o1.c
+++ b/testsuites/libtests/dl07/dl07-o1.c
@@ -38,14 +38,11 @@
  * separated text and data and this means there is no actual section in the ELF
  * file, the details for this are in the symbols.
  */
-int dl01_bss1;/* unitialised, .bss */
-float   dl01_bss2[30];/* unitialised, .bss */
-chardl01_bss3[10];/* unitialised, .bss */
-int dl01_data1 = 1;   /* initialised, .data */
-float   dl01_data2 = 0.;  /* initialised, .data */
-const int   dl01_const1 = 3;  /* read-only, .const */
-const float dl01_const2 = 0.666;  /* read-only, .const */
-int dl01_func1(void)  /* code, .text */
+int   dl01_bss1;/* unitialised, .bss */
+char  dl01_bss3[10];/* unitialised, .bss */
+int   dl01_data1 = 1;   /* initialised, .data */
+const int dl01_const1 = 3;  /* read-only, .const */
+int dl01_func1(void)/* code, .text */
 {
   return 4;
 }
@@ -63,13 +60,10 @@ int rtems_main_o1 (void)
 {
   printf (DL_NAME ": module: %s\n", dl_localise_file (__FILE__));
   printf (DL_NAME ": dl01_bss1: %4zu: %p: %d\n",   PAINT_VAR 
(dl01_bss1));
-  printf (DL_NAME ": dl01_bss2: %4zu: %p: %f\n",   PAINT_VAR 
(dl01_bss2[0]));
   printf (DL_NAME ": dl01_bss3: %4zu: %p: %02x\n", PAINT_VAR 
(dl01_bss3[0]));
   printf (DL_NAME ":dl01_data1: %4zu: %p: %d\n",   PAINT_VAR 
(dl01_data1));
   /* no  %f in the rtems test 

[PATCH 5/5] microblaze: Add dl05 to expected failures

2023-08-27 Thread Alex White
Updates #4949
---
 .../bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml  | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
index 7ff9350cf4..7ae7005bf0 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
@@ -6,6 +6,12 @@ actions:
 state: exclude
 tests:
 - minimum
+- set-test-state:
+reason: |
+  Expected to fail due to GCC issues.
+state: expected-fail
+tests:
+- dl05
 build-type: option
 copyrights:
 - Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
-- 
2.34.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/5] microblaze: Add libdl support

2023-08-27 Thread Alex White
---
 cpukit/libdl/rtl-mdreloc-microblaze.c | 291 ++
 cpukit/libdl/rtl-tls.c|   2 +-
 .../microblaze/include/machine/elf_machdep.h  |  83 +
 spec/build/cpukit/cpumicroblaze.yml   |   3 +
 spec/build/cpukit/objdl.yml   |   2 +
 spec/build/cpukit/objdlmicroblaze.yml |  15 +
 spec/build/cpukit/optlibdl.yml|   1 +
 7 files changed, 396 insertions(+), 1 deletion(-)
 create mode 100644 cpukit/libdl/rtl-mdreloc-microblaze.c
 create mode 100644 cpukit/score/cpu/microblaze/include/machine/elf_machdep.h
 create mode 100644 spec/build/cpukit/objdlmicroblaze.yml

diff --git a/cpukit/libdl/rtl-mdreloc-microblaze.c 
b/cpukit/libdl/rtl-mdreloc-microblaze.c
new file mode 100644
index 00..b8834b203b
--- /dev/null
+++ b/cpukit/libdl/rtl-mdreloc-microblaze.c
@@ -0,0 +1,291 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (C) 2023 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "rtl-elf.h"
+#include "rtl-error.h"
+#include 
+#include "rtl-unwind.h"
+#include "rtl-unwind-dw2.h"
+
+uint32_t
+rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
+ const Elf_Shdr*  shdr) {
+  (void) obj;
+  (void) shdr;
+  return 0;
+}
+
+uint32_t
+rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
+  int  section,
+  const char*  name,
+  const Elf_Shdr*  shdr,
+  const uint32_t   flags) {
+  (void) obj;
+  (void) section;
+  (void) name;
+  (void) shdr;
+  return flags;
+}
+
+bool
+rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
+  rtems_rtl_obj_sect*  sect) {
+  (void) obj;
+  (void) sect;
+  return false;
+}
+
+bool
+rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
+ rtems_rtl_obj_sect*  sect) {
+  (void) obj;
+  (void) sect;
+  return false;
+}
+
+bool
+rtems_rtl_elf_rel_resolve_sym (Elf_Word type) {
+  return type != 0;
+}
+
+size_t
+rtems_rtl_elf_relocate_tramp_max_size (void) {
+  /*
+   * Disable by returning 0.
+   */
+  return 0;
+}
+
+rtems_rtl_elf_rel_status
+rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj*obj,
+  const Elf_Rel*rel,
+  const rtems_rtl_obj_sect* sect,
+  const char*   symname,
+  const Elf_Bytesyminfo,
+  const Elf_Wordsymvalue) {
+  (void) obj;
+  (void) rel;
+  (void) sect;
+  (void) symname;
+  (void) syminfo;
+  (void) symvalue;
+  return rtems_rtl_elf_rel_no_error;
+}
+
+static void write16le(void *loc, uint16_t val) {
+  *((uint16_t *) loc) = val;
+}
+
+static void write32le(void *loc, uint32_t val) {
+  *((uint32_t *) loc) = val;
+}
+
+static uint16_t read16le(void *loc) {
+  return *((uint16_t *) loc);
+}
+
+static uint32_t read32le(void *loc) {
+  return *((uint32_t *) loc);
+}
+
+static rtems_rtl_elf_rel_status
+rtems_rtl_elf_reloc_rela (rtems_rtl_obj*obj,
+  const Elf_Rela*   rela,
+  const rtems_rtl_obj_sect* sect,
+  const char*   symname,
+  const Elf_Bytesyminfo,
+  const Elf_Wordsymvalue,
+  const 

[PATCH 4/5] microblaze: Add dl06 to expected failures

2023-08-27 Thread Alex White
Updates #4948
---
 spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
index 665d4d0d54..7ff9350cf4 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/tstkcu105_qemu.yml
@@ -12,5 +12,7 @@ copyrights:
 default: []
 description: ''
 enabled-by: true
-links: []
+links: 
+- role: build-dependency
+  uid: ../../tst-xfail-dl06
 type: build
-- 
2.34.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 3/5] microblaze: Align exception-related sections

2023-08-27 Thread Alex White
This fixes unaligned data access exceptions found while debugging test
dl05.
---
 spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml 
b/spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml
index 9a3ca11b51..4f9b310ad3 100644
--- a/spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml
+++ b/spec/build/bsps/microblaze/microblaze_fpga/linkcmds.yml
@@ -104,20 +104,20 @@ content: |
 } > REGION_RODATA AT > REGION_RODATA_LOAD
 
 _frodata = . ;
-.rodata : {
+.rodata : ALIGN_WITH_INPUT {
   *(.rodata)
   *(.rodata.*)
   *(.gnu.linkonce.r.*)
   CONSTRUCTORS; /* Is this needed? */
 } > REGION_RODATA AT > REGION_RODATA_LOAD
 _erodata = .;
-.eh_frame : {
-  *(.eh_frame)
+.eh_frame : ALIGN_WITH_INPUT {
+  KEEP (*(.eh_frame))
 } > REGION_RODATA AT > REGION_RODATA_LOAD
 .jcr : {
   *(.jcr)
 } > REGION_RODATA AT > REGION_RODATA_LOAD
-.gcc_except_table : {
+.gcc_except_table : ALIGN_WITH_INPUT {
   *(.gcc_except_table)
 } > REGION_RODATA AT > REGION_RODATA_LOAD
 .tdata : ALIGN_WITH_INPUT {
-- 
2.34.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 0/5] Add libdl support to MicroBlaze

2023-08-27 Thread Alex White
Hi,

This patch set adds libdl support to MicroBlaze. All tests pass except for dl05
and dl06. To get dl07, dl08, and dl09 to pass, I removed the use of floating
point numbers from those tests.

Alex

Alex White (5):
  microblaze: Add libdl support
  testsuites/libtests: Remove floats from libdl tests
  microblaze: Align exception-related sections
  microblaze: Add dl06 to expected failures
  microblaze: Add dl05 to expected failures

 cpukit/libdl/rtl-mdreloc-microblaze.c | 291 ++
 cpukit/libdl/rtl-tls.c|   2 +-
 .../microblaze/include/machine/elf_machdep.h  |  83 +
 .../microblaze/microblaze_fpga/linkcmds.yml   |   8 +-
 .../microblaze_fpga/tstkcu105_qemu.yml|  10 +-
 spec/build/cpukit/cpumicroblaze.yml   |   3 +
 spec/build/cpukit/objdl.yml   |   2 +
 spec/build/cpukit/objdlmicroblaze.yml |  15 +
 spec/build/cpukit/optlibdl.yml|   1 +
 testsuites/libtests/dl07/dl-o1.h  |  11 +-
 testsuites/libtests/dl07/dl-o2.h  |   8 +-
 testsuites/libtests/dl07/dl-o4.h  |   1 -
 testsuites/libtests/dl07/dl07-o1.c|  16 +-
 testsuites/libtests/dl07/dl07-o2.c|  13 +-
 testsuites/libtests/dl07/dl07-o3.c|   6 -
 testsuites/libtests/dl07/dl07-o4.c|   5 -
 testsuites/libtests/dl07/dl07-o5.c|   3 -
 testsuites/libtests/dl08/dl-o1.h  |  11 +-
 testsuites/libtests/dl08/dl-o2.h  |   8 +-
 testsuites/libtests/dl08/dl-o4.h  |   1 -
 testsuites/libtests/dl08/dl08-o1.c|  16 +-
 testsuites/libtests/dl08/dl08-o2.c|  10 +-
 testsuites/libtests/dl08/dl08-o3.c|   1 -
 testsuites/libtests/dl08/dl08-o4.c|   2 -
 testsuites/libtests/dl09/dl-o1.h  |  11 +-
 testsuites/libtests/dl09/dl-o2.h  |   8 +-
 testsuites/libtests/dl09/dl-o4.h  |   1 -
 testsuites/libtests/dl09/dl09-o1.c|  16 +-
 testsuites/libtests/dl09/dl09-o2.c|  10 +-
 testsuites/libtests/dl09/dl09-o3.c|   1 -
 testsuites/libtests/dl09/dl09-o4.c|   2 -
 31 files changed, 454 insertions(+), 122 deletions(-)
 create mode 100644 cpukit/libdl/rtl-mdreloc-microblaze.c
 create mode 100644 cpukit/score/cpu/microblaze/include/machine/elf_machdep.h
 create mode 100644 spec/build/cpukit/objdlmicroblaze.yml

-- 
2.34.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel