#2802 closed defect (fixed)

Test "libdl (RTL) 5" fails on SPARC targets

Reported by: Sebastian Huber Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: lib/dl Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

On GR740 I get:

rtl: RELOC_32 0x60ae8 @ 0x86edc in /dl-o5.o
rtl: relocation: .rela.eh_frame, syms:.symtab
rtl: rela: sym:__gxx_personality_v0(20)=00001dec type:3  off:00000013 addend:0

CPU 0:  IU in error mode (tt = 0x07, mem address not aligned)
        0x0001fa9c: c4040000  ld  [%l0], %g2  <rtems_rtl_elf_relocate_rela+204>
CPU 1:  Power down mode
CPU 2:  Power down mode
CPU 3:  Power down mode

On GR712RC I get:

rtl: WDISP_30 0x7ffe2ccd @ 0x40087108 in /dl-o5.o
rtl: relocation: .rela.gcc_except_table.exception_dl, syms:.symtab
rtl: rela: sym:_ZTISt9exception(32)=40060ae8 type:3  off:00000034 addend:0
rtl: RELOC_32 0x40060ae8 @ 0x400871b4 in /dl-o5.o
rtl: relocation: .rela.eh_frame, syms:.symtab
rtl: rela: sym:__gxx_personality_v0(20)=40001dec type:3  off:00000013 addend:0

Target resets now.

Attachments (1)

libdl-sparc-R_SPARC_32-missaligned.patch (1.2 KB) - added by Chris Johns on Nov 11, 2016 at 6:09:35 AM.
Miss-aligned R_SPARC_32 offset work around.

Download all attachments as: .zip

Change History (12)

comment:1 Changed on Nov 10, 2016 at 5:39:59 AM by Chris Johns

This is due to the following relocation record:

Relocation section '.rela.eh_frame' at offset 0x5fe8 contains 3 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000013  00001403 R_SPARC_32        00000000   __gxx_personality_v0 + 0

The type is R_SPARC_32 is declared as being aligned however the offset is 0x13 and this causes a misaligned access.

Last edited on Nov 10, 2016 at 5:40:35 AM by Chris Johns (previous) (diff)

comment:2 Changed on Nov 10, 2016 at 7:32:09 AM by Sebastian Huber

Is this a bug in the tool chain or the libdl?

comment:3 Changed on Nov 10, 2016 at 7:46:01 AM by Chris Johns

I am investigating. At this stage it looks like a bug in gas. Binutils contain code that checks the lower bits of the address and selects either R_SPARC_32 or UA32. I am looking to make a suitable test case so I can see what is happening.

Changed on Nov 11, 2016 at 6:09:35 AM by Chris Johns

Miss-aligned R_SPARC_32 offset work around.

comment:5 Changed on Nov 11, 2016 at 6:10:48 AM by Chris Johns

I have attached a work-around which allows dl05 to run and fail in the expected manner.

We can review the status of this patch once we get some feedback from the binutil's community.

comment:6 Changed on Nov 14, 2016 at 2:24:08 PM by Jiri Gaisler <jiri@…>

In 316da9356ad7b612f6df6ed1e47b62268450438e/rtems:

Error: Processor CommitTicketReference failed
/data/trac/repo/rtems.git does not appear to be a Git repository.

comment:7 Changed on Nov 22, 2016 at 6:41:39 AM by Sebastian Huber

Now the test terminates with

rtl: UA_32 0x8c6d8 @ 0x8c755 in /dl-o5.o
rtl: alloc: del: SYMBOL addr=0x8c780
rtl: alloc: new: OBJECT addr=0x8c7e8 size=132
rtl: linkmap_add
rtl: unresolv: global resolve

dlopen: 
dlsym: 
exception_base called
exception_dl: throwing
terminate called after throwing an instance of 'std::runtime_error'
  what():  exception_dl throw

comment:8 Changed on Nov 22, 2016 at 9:26:11 PM by Chris Johns

This error is the expected result of the test. It does not pass. See #2767 for the original issue that raised the problem.

Last edited on Nov 22, 2016 at 9:26:59 PM by Chris Johns (previous) (diff)

comment:9 Changed on Nov 23, 2016 at 6:04:02 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:10 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:11 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.