[RTEMS Project] #2704: Weak symbols not found by loaded code

RTEMS trac trac at rtems.org
Tue May 10 21:16:58 UTC 2016


#2704: Weak symbols not found by loaded code
----------------------+--------------------------------
 Reporter:  pggauvin  |      Owner:  chrisj
     Type:  defect    |     Status:  new
 Priority:  normal    |  Milestone:
Component:  libdl     |    Version:  4.11
 Severity:  normal    |   Keywords:  libdl, weak symbol
----------------------+--------------------------------
 In the attached test case, the symbol `base_func` is defined weakly in the
 base image. The loaded object has a reference to `base_func`, and the
 loader is unable to resolve it:
 {{{
 Unresolved symbols: 1 (dlerror: global symbol not found: base_func)
 }}}
 The expected behavior is for the reference to be resolved to the weak
 `base_func`, since there is no globally exported symbol with the same name
 present. Note that `base_func` does not show up in the initial `rtl:
 esyms: ...` messages.

 Possibly of note, if `base_func` is defined in the loaded object (weak or
 not), its `base_func` reference is resolved to the symbol in the loaded
 object at load time, BUT the base image still uses its own `base_func`
 (even if the loaded `base_func` is not weak). This can be tested by
 uncommenting lines at the end of lib.c.

 Steps to reproduce (you may have to edit `BSP_DIR` in the Makefile):
 {{{
 make clean all
 qemu-system-arm -m 256M -M xilinx-zynq-a9 -serial null -serial mon:stdio
 -nographic \
   -no-reboot -kernel libdl-weak-sym-test.exe
 }}}

 Development Environment:
 * '''RTEMS Version''': 4.11 (Branch "4.11", commit
 2145853b009e939dfbe14869b710133f50500a26)
 * '''System Type''': ARM Cortex-A9, xilinx_zynq_a9_qemu BSP
 * '''GCC Version''':
     arm-rtems4.11-gcc (GCC) 4.9.3 20150626 (RTEMS 4.11, RSB
 aa3fdad01a0dbc3cbfd7c49e1ea07ff1a585c0b9 (HEAD, origin/4.11,
 4.11)-modified, Newlib 2.2.0.20150423)
 * '''RTEMS Configure Options''':
     --target=arm-rtems4.11 --enable-rtemsbsp="xilinx_zynq_a9_qemu
 xilinx_zynq_zedboard xilinx_zynq_csp_cots xilinx_zynq_csp_hybrid"
 --enable-tests=samples --enable-posix
 --prefix=$HOME/development/rtems/4.11 --disable-networking

--
Ticket URL: <http://devel.rtems.org/ticket/2704>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list