This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] restore trampoline support on ppc-vxworks


Hello,

On ppc-vxworks, use of trampolines trigger calls to __trampoline_setup,
expectedly provided by libgcc.

It currently isn't there, causing "unresolved symbol" warnings by
e.g. the windsh loader for modules using pointers to nested functions,
followed by runtime misbehavior.

The corresponding code is written in assembly language, in
config/rs6000/tramp.asm, included into libgcc by way of

  t-ppcomm
  # Common support for PowerPC ELF targets (both EABI and SVR4).
  LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c

on eabi/svr4 targets.

VxWorks is a bit special in this family, because it has LIB2FUNCS_EXTRAs
of its own. We currently have, included in this order:

 config/t-vxworks
 LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c
 
 config/rs6000/t-ppccomm
 LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c

 config/rs6000/t-vxworks
 LIB2FUNCS_EXTRA = $(srcdir)/config/vxlib.c

... So no tramp.S in the list, eventually.

The history is a bit twisted here: at some point, tramp.S used to be
included as desired because there used not to be a '+' in ppccomm,
there was one in rs6000/t-vxworks, and there was no darwin-ldouble
involved. Then things changed ...

I see no reason why the "common" bits should not be generally included
in principle. tramp.S is certainly needed, and dwarwin-ldouble.c is I
think harmless.

It appears to me like the current situation, with tramp.S excluded
+ __trampoline_setup missing, is not quite as intended, and attached
is a patch suggestion to address this.

The idea is simple: remove the assignment in rs6000/t-vxworks, to get
both vxlib.c from the common t-vxworks fragment + tramp.S et al from
t-ppccomm.

Tested by verifying that both vxlib.o and tramp.o end up in libgcc.a
after the change, and that a simple testcase using a pointer to nested
function now works while it didn't before (powerpc-wrs-vxworks cross
hosted on x86-linux).

Thanks in advance,

Olivier

2006-10-07  Olivier Hainque  <hainque@adacore.com>

	* config/rs6000/t-vxworks: Remove assignment to LIB2FUNCS_EXTRA.





 




Attachment: vx-tramp_setup.dif
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]