]> git.ipfire.org Git - thirdparty/gcc.git/commit
Tigthen libc_internal and crtstuff for VxWorks shared objects
authorFrederic Konrad <konrad@adacore.com>
Thu, 5 Nov 2020 10:34:57 +0000 (11:34 +0100)
committerOlivier Hainque <hainque@adacore.com>
Mon, 13 Dec 2021 18:03:03 +0000 (18:03 +0000)
commit4099d6501e3526ca8d1d01e904f42b83c6824674
treede1958f3de2156933e67882c59efcbc38d2ec928
parent0515c95d5fe0a865f688f3ab89572b917e8f0185
Tigthen libc_internal and crtstuff for VxWorks shared objects

This change tightens and documents the use of libc_internal, then
strengthens the VxWorks crtstuff objects for the support of shared
libraries. In particular:

- Define __dso_handle, which libstdc++.so requires,

- Provide _init and _fini functions to run through the init/fini arrays
  for shared libs in configurations which HAVE_INITFINI_ARRAY_SUPPORT.

The init/fini functions are provided by libc_internal.a for static links
but with slightly different names and we don't want to risk dragging other
libc_internal contents in the closure accidentally so make sure we don't
link with it.

As for the !vxworks crtstuff, the new shared libs specific bits are
conditioned by a CRTSTUFFS_O macro, for which we provide new Makefile
fragment.

The bits to actually use the fragment and the shared objects will
be added by a forthcoming change, as part of a more general configury
update for shared libs.

The change also adds guards the eh table registration code
in vxcrtstuff so the objects can be used for either init/fini
or eh tables independently.

2021-12-07  Fred Konrad  <konrad@adacore.com>
    Olivier Hainque  <hainque@adacore.com>

gcc/
* config/vxworks.h (VXWORKS_BASE_LIBS_RTP): Guard -lc_internal
on !shared+!non-static and document.
(VXWORKS_LIB_SPEC): Remove the bits intended to drag the
init/fini functions from libc_internal in the shared lib case.
(VX_CRTBEGIN_SPEC/VX_CRTEND_SPEC): Use vxcrtstuff objects also in
configurations with shared lib and INITFINI_ARRAY support.

libgcc/
* config/t-vxcrtstuffS: New Makefile fragment.
* config/vxcrtstuff.c: Provide __dso_handle. Provide _init/_fini
functions for INITFINI_ARRAY support in shared libs and guard
the definition of eh table registration functions on conditions
indicating they are needed.
gcc/config/vxworks.h
libgcc/config/t-vxcrtstuffS [new file with mode: 0644]
libgcc/config/vxcrtstuff.c