On Mon, 14 Mar 2022 08:19:41 GMT, Florian Weimer <fwei...@openjdk.org> wrote:

> > Thanks a lot, Florian! I got it to work under Linux x64.
> 
> Great!
> 
> > My error was that I had declared the label in C++ as `extern void* 
> > SafeFetch_continuation`. Declaring it as `extern char 
> > _SafeFetch32_continuation[] __attribute__ ((visibility ("hidden")));` as 
> > you suggested does the trick. I'm not sure I understand the difference.
> 
> Your approach might have worked as well, but you would have to use 
> `&SafeFetch_continuation` on the C++ side. Arrays work directly because of 
> pointer decay.

Ah, that makes sense. I wondered why the address did not look like a code 
pointer in C++.

Anyway, got Linux x86_32 working too. Now I am working on aarch64. 

> 
> Anyway, from what I've seen, the array is more idiomatic.
> 
> > > It doesn't hurt, but the Itanium ABI does not mangle such global data 
> > > symbols, so it's not strictly needed.
> > 
> > 
> > I don't understand this remark, what does Itanium have to do with this?
> 
> The [C++ ABI definition](https://github.com/itanium-cxx-abi/cxx-abi) is 
> probably Itanium's most lasting contribution to computing. I think it's used 
> on most non-Windows systems these days, not just on Linux, and of course on 
> all kinds of CPUs.

Interesting to know. Thanks!

-------------

PR: https://git.openjdk.java.net/jdk/pull/7727

Reply via email to