create_nmf.py not finding needed libraries

22 views
Skip to first unread message

Lionel G Landwerlin

unread,
Aug 21, 2015, 6:18:26 AM8/21/15
to Native-Client-Discuss
Hi,

I've compiled a small NaCl application with a dependency on SDL (using naclports).
Calling the create_nmf.py script to generate a nmf file doesn't seem to include any of the library the application depends on.

Tracing the create_nmf.py script a bit, it seems IsDynamicElf() (from elf.py) doesn't consider my application as dynamically linked.

Is this coherent with the following objdump -x ? : 

myapp_x86_64.nexe:     file format elf64-x86-64-nacl
myapp_x86_64.nexe
architecture: i386:x86-64:nacl, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000005180

Program Header:
    LOAD off    0x0000000000010000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**16
         filesz 0x0000000000030000 memsz 0x0000000000030000 flags r-x
    LOAD off    0x0000000000040000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**16
         filesz 0x0000000000010128 memsz 0x0000000000010128 flags r--
    LOAD off    0x0000000000050128 vaddr 0x0000000010020128 paddr 0x0000000010020128 align 2**16
         filesz 0x0000000000001e38 memsz 0x0000000000001e38 flags rw-
    LOAD off    0x0000000000060000 vaddr 0x0000000010030000 paddr 0x0000000010030000 align 2**16
         filesz 0x0000000000000000 memsz 0x00000000000033e4 flags rw-
 DYNAMIC off    0x0000000000050290 vaddr 0x0000000010020290 paddr 0x0000000010020290 align 2**3
         filesz 0x0000000000000210 memsz 0x0000000000000210 flags rw-
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
     TLS off    0x0000000000050128 vaddr 0x0000000010020128 paddr 0x0000000010020128 align 2**2
         filesz 0x0000000000000000 memsz 0x0000000000000004 flags r--
    NOTE off    0x0000000000040000 vaddr 0x0000000010000000 paddr 0x0000000010000000 align 2**2
         filesz 0x0000000000000024 memsz 0x0000000000000024 flags r--

Dynamic Section:
  NEEDED               libnacl_io.so
  NEEDED               libppapi_gles2.so
  NEEDED               libppapi_simple.so
  NEEDED               libpthread.so.11835d88
  NEEDED               libSDL-1.2.so.0
  NEEDED               libz.so.1
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.11835d88
  NEEDED               ld-nacl-x86-64.so.1
  SONAME               myapp_x86_64.nexe
  INIT                 0x0000000000000000
  FINI                 0x000000000002bf60
  HASH                 0x0000000010000028
  STRTAB               0x0000000010003728
  SYMTAB               0x0000000010000b90
  STRSZ                0x0000000000001b99
  SYMENT               0x0000000000000018
  PLTGOT               0x0000000010020708
  PLTRELSZ             0x0000000000001e48
  PLTREL               0x0000000000000007
  JMPREL               0x00000000100071e8
  RELA                 0x0000000010005748
  RELASZ               0x0000000000001aa0
  RELAENT              0x0000000000000018
  VERNEED              0x0000000010005668
  VERNEEDNUM           0x0000000000000004
  VERSYM               0x00000000100052c2

Version References:
  required from ld-nacl-x86-64.so.1:
    0x0d696913 0x00 09 GLIBC_2.3
    0x0d696914 0x00 07 GLIBC_2.4
  required from libgcc_s.so.1:
    0x0b792650 0x00 11 GCC_3.0
    0x0d696910 0x00 05 GLIBC_2.0
  required from libc.so.11835d88:
    0x0d696917 0x00 10 GLIBC_2.7
    0x09691972 0x00 08 GLIBC_2.3.2
    0x09691a75 0x00 03 GLIBC_2.2.5
  required from libpthread.so.11835d88:
    0x09691972 0x00 06 GLIBC_2.3.2
    0x09691973 0x00 04 GLIBC_2.3.3
    0x09691a75 0x00 02 GLIBC_2.2.5


Thanks,

-
Lionel

Ben Smith

unread,
Aug 21, 2015, 12:33:38 PM8/21/15
to Native-Client-Discuss
What are your arguments to create_nmf.py? What is the generated nmf file? Are there any files in the lib32/lib64 directories?

I can't remember the exact command, but you'll need to stage dependencies (-s) and include additional lib dirs (-L), I believe. The examples in the SDK do this automatically, take a look at the commands they run (make TOOLCHAIN=glibc V=1).

Lionel G Landwerlin

unread,
Aug 24, 2015, 9:05:45 AM8/24/15
to Native-Client-Discuss
Thanks,

Looks like I had one of the linker's option wrong.
It works properly now, without any special option to create_nmf.py.

-
Lionel
Reply all
Reply to author
Forward
0 new messages