0

I'm going to assemble a program. But errors followed.

gcc -no-pie final.s -ldl -lm -lz -lrt -lpthread -lcrypt -lgmp -m64
/usr/bin/ld: error in /tmp/ccjXcZiN.o(.eh_frame); no .eh_frame_hdr table will be created.
/tmp/ccjXcZiN.o: In function `S_0x404C5A':
(.text+0x775): undefined reference to `have_libloaded'
/tmp/ccjXcZiN.o: In function `BB_73':
(.text+0x78f): undefined reference to `libhandle'
/tmp/ccjXcZiN.o: In function `BB_74':
(.text+0x79c): undefined reference to `load_library_errmsg'
/tmp/ccjXcZiN.o: In function `S_0x404CA0':
(.text+0x7bf): undefined reference to `have_libloaded'
collect2: error: ld returned 1 exit status

I know that there're some other libraries needed on the machine. But i can't search for the specific library name.

S1mple
  • 35
  • 6
  • 1
    I googled [libappimage](https://github.com/AppImage/libappimage/blob/master/src/patches/squashfuse_dlopen.c). Maybe that helps. Alternatively, just collect all the symbols from all the libraries on your system with a script. – Jester Mar 05 '22 at 11:51
  • Error in `.eh_frame`? That's odd, that's stack-unwind info. Does your `.s` use `.cfi` directives in an illegal way? – Peter Cordes Mar 05 '22 at 11:57
  • Please show your source code or provide a [mcve]. – fuz Mar 05 '22 at 12:11
  • eh... Sorry but i don't have source code. Abstractly speaking, The assembly code was produced by a tool, not directly from source code. And I'm testing the tool with some realworld programs(execuable files) as input. – S1mple Mar 06 '22 at 06:50
  • @PeterCordes Thanks for your help! But the problem seemingly doesn't matter. I've used other binaries as input with the same problem. But the output binary can run smoothly. – S1mple Mar 06 '22 at 06:54
  • @Jester Thanks for your help! I've installed the library and added '-lappimage' option to gcc. But errors were still the same. But four undefined references(in fact three) can be found in src/patches/squashfuse_dlopen.h. So i guess libappimage is exactly the missing library.And latest libappimage(v1.0.4) has been installed. But the lib file libappimage.so was linked to another file libappimage.so.1.0.3, which seems to be an older version. I have no idea if this is related to the problem. – S1mple Mar 06 '22 at 15:25
  • That sounds like it may be a patch to fuse, so try `-lfuse`? What kind of program is it? Does it make sense for it to use appimage or fuse? – Jester Mar 07 '22 at 15:36
  • @Jester Thanks! I've tried the arguments `-lfuse` but the errors still occured. The input program is an Appimage release of [cutter](https://github.com/rizinorg/cutter). And the tool is [uroboros](https://github.com/s3team/uroboros). – S1mple Mar 10 '22 at 07:42

0 Answers0