#3155 new defect

libdl not supported on 64-bit PowerPC

Reported by: Sebastian Huber Owned by: joel.sherrill@…
Priority: normal Milestone: Indefinite
Component: score Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

There are several warnings:

cpukit/libdl/rtl-elf.c:253:46: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:253:64: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'Elf32_Word {aka const unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:263:45: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:263:63: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'Elf32_Word {aka const unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:307:54: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:320:49: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-elf.c:87:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-elf.c:98:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:104:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:114:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:123:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:143:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:152:43: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:156:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:163:44: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:166:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:177:43: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:186:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'Elf32_Word {aka const unsigned int}' [-Wformat=]
cpukit/libdl/rtl-mdreloc-powerpc.c:186:56: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
cpukit/libdl/rtl-mdreloc-powerpc.c:189:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:189:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:191:63: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
cpukit/libdl/rtl-mdreloc-powerpc.c:63:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-mdreloc-powerpc.c:92:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
cpukit/libdl/rtl-obj.c:782:61: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-obj.c:782:67: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:214:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:269:49: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:318:33: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:318:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:318:55: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:334:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-rap.c:374:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cpukit/libdl/rtl-rap.c:389:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:389:19: warning: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:389:48: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:409:19: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:409:19: warning: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'Elf32_Word {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:409:47: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:614:42: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:614:55: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:614:69: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:643:64: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:819:40: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:826:38: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:838:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:850:32: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:867:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:888:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:888:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:888:56: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:888:67: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:916:45: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:946:37: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:946:47: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:968:40: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-rap.c:975:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uint32_t {aka unsigned int}' [-Wformat=]
cpukit/libdl/rtl-shell.c:217:34: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint32_t {aka unsigned int}' [-Wformat=]

Due to vast ABI differences between 32-bit and 64-bit PowerPC it is unlikely that libdl is supported on PowerPC.

Change History (7)

comment:1 in reply to:  description ; Changed on Oct 3, 2017 at 4:57:06 AM by Chris Johns

Replying to Sebastian Huber:

Due to vast ABI differences between 32-bit and 64-bit PowerPC it is unlikely that libdl is supported on PowerPC.

Do you mean PowerPC 64bit or any PowerPC?

What do you propose?

comment:2 in reply to:  1 ; Changed on Oct 3, 2017 at 6:13:50 AM by Sebastian Huber

Replying to Chris Johns:

Replying to Sebastian Huber:

Due to vast ABI differences between 32-bit and 64-bit PowerPC it is unlikely that libdl is supported on PowerPC.

Do you mean PowerPC 64bit or any PowerPC?

64-bit PowerPC.

What do you propose?

We can probably fix the warnings with a small amount of work, however, a real 64-bit support is probably some more work.

comment:3 in reply to:  2 Changed on Oct 3, 2017 at 11:10:57 PM by Chris Johns

Replying to Sebastian Huber:

Replying to Chris Johns:

What do you propose?

We can probably fix the warnings with a small amount of work, however, a real 64-bit support is probably some more work.

Fixing the warning is a good idea. Yes there are some spots that need to be fixed. The host side for 64bit and 32bit support needs some changes and the RAP format would need some work.

comment:4 Changed on Oct 6, 2017 at 7:14:43 AM by Sebastian Huber

I guess this prototype is wrong

bool
rtems_rtl_elf_find_symbol (rtems_rtl_obj_t* obj,
                           const Elf_Sym*   sym,
                           const char*      symname,
                           Elf_Word*        value)

It should probably be Elf_Addr *value.

comment:5 Changed on Oct 6, 2017 at 10:47:07 AM by Sebastian Huber <sebastian.huber@…>

In 4e38aed/rtems:

libdl: Use 64-bit ELF on 64-bit targets

Update #3155.

comment:6 Changed on Oct 6, 2017 at 10:47:19 AM by Sebastian Huber <sebastian.huber@…>

In 8bdbefe/rtems:

libdl: Fix warnings

Update #3155.

comment:7 in reply to:  4 Changed on Oct 7, 2017 at 12:07:22 AM by Chris Johns

Replying to Sebastian Huber:

I guess this prototype is wrong

bool
rtems_rtl_elf_find_symbol (rtems_rtl_obj_t* obj,
                           const Elf_Sym*   sym,
                           const char*      symname,
                           Elf_Word*        value)

It should probably be Elf_Addr *value.

Yes I agree. Once you highlight this is makes perfect sense. Thank you for taking the time to fix these issues.

Note: See TracTickets for help on using tickets.