>From http://llvm.org/bugs/show_bug.cgi?id=6223

Xerxes RÄnby wrote:

> I am considering implementing the missing parts to make the
> thumb backend work with the ExecutionEngine JIT in order for
> the llvm JIT to be used on Ubuntu Lucid ARM that targets
> thumb2.
> 
> see: llvm needs porting to thumb2
> https://bugs.launchpad.net/ubuntu/+source/llvm/+bug/513735
> 
> Any pointers to how to implement the missing parts for the
> thumb JIT would be mosty welcome.
> 
> I will start trying to add the missing machinecode fields for
> the JIT to use to the ARMInstrThumb.tb and ARMInstrThumb2.tb
> tablegen files.

Adding Thumb-2 JIT support is not necessarily required.

The real requirement is to implement ARM/Thumb interworking - for Ubuntu
it sounds like this will be needed even if the JIT generates Thumb-2
code.

The reason for this is that direct symbol reference resolves to a PLT
veneer generated at link time (always in ARM), whereas dlsym() will
resolve directly to the target symbol in the containing shared library
(which may be Thumb), as shown by the example below --- and it sounds
like the llvm JIT output may need to handle both.


I documented some more detailed info on the porting requirements for ARM/Thumb 
interworking on https://wiki.ubuntu.com/ARM/Thumb2PortingHowto, which may help 
explain the implications and what porting is likely to be needed.


$ cat <<EOF | gcc -o dlsym-test -xc - -ldl && ./dlsym-test
#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
int main(void)
{
    printf("printf = %p\ndlsym("printf") = %p\n", printf, dlsym(RTLD_NEXT, 
"printf"));
    return 0;
}
EOF

printf = 0x83a8
dlsym("printf") = 0x4006e1cd

** Also affects: llvm via
   http://llvm.org/bugs/show_bug.cgi?id=6223
   Importance: Unknown
       Status: Unknown

-- 
[arm] needs porting to thumb2
https://bugs.launchpad.net/bugs/513735
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to