public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] ld-linux.so
@ 2000-04-23  6:45 Laurent Morichetti
  2000-04-23  9:02 ` Jes Sorensen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Laurent Morichetti @ 2000-04-23  6:45 UTC (permalink / raw)
  To: linux-ia64

In glibc/sysdeps/ia64/dl-machine.h the macro TRAMPOLINE_TEMPLATE saves the
input registers but not r8 (pointer to value returned in memory). r8 should
be preserved across the runtime fixup.

The following example fails on linux-ia64:

foo.hpp:
===
class foo {
public:
  long _a;
  long _b;
  foo(long a, long b) : _a(a), _b(b) {}
};
extern foo bar(long a, long b);

bar.cpp:
===
#include "foo.hpp"

foo bar(long a, long b) { return foo(a, b); }

foo.cpp:
===
#include <stdlib.h>
#include <stdio.h>
#include "foo.hpp"

int main() {
  foo f = bar(1, 2);
  fprintf(stdout, "a=%ld, b=%ld\n", f._a, f._b);
  return EXIT_SUCCESS;
}


$ g++ -fPIC -shared -o libbar.so bar.cpp
$ g++ -o foo foo.cpp -L. -lbar

-Laurent







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-04-24 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-23  6:45 [Linux-ia64] ld-linux.so Laurent Morichetti
2000-04-23  9:02 ` Jes Sorensen
2000-04-23 16:52 ` Kevin Buettner
2000-04-24  9:01 ` Jes Sorensen
2000-04-24 11:08 ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox