0

I have made a go plugin which contains references to third party libraries. So I have a sample function which looks like this:

CreateEchoObject() *echo.Echo {
  e := echo.New()
}

The disassembled code of CreateEchoObject contains:

callq  8b9ab0 <_init+0xf0>

8b9ab0 is present in plt.got table.

Here everything is working well, but for one of my other functions it does not.

func HttpRouterNew() *Router {
    router := httprouter.New() 
}

For the above function the disassembled code looks like this:

<projects/package.HttpRouterNew>:
  mov    0x8f1a21(%rip),%rcx        # 1736b08 <_GLOBAL_OFFSET_TABLE_+0xd18>
  mov    %fs:(%rcx),%rcx
  cmp    0x10(%rcx),%rsp
  jbe    e4522a <projects/package.HttpRouterNew+0x14a>
  sub    $0x30,%rsp
  mov    %rbp,0x28(%rsp)
  lea    0x28(%rsp),%rbp
  mov    0x8f2e5e(%rip),%rax        # 1737f68 <_GLOBAL_OFFSET_TABLE_+0x2178>
  mov    %rax,(%rsp)
  callq  8cab60 <runtime.newobject>
  mov    0x8(%rsp),%rax

As you can see, there is no call similar to the above function. Using an elf file parser, I have found The symbol name of 1737f68 in GOT is type.EFOOALAY and 1736b08 is runtime.tlsg. Also I cannot find any reference to httprouter.New in the plt.got table.

  • 1
    Maybe that call gets inlined? Check [No symbol in binary after "go build"](https://stackoverflow.com/questions/68321483/no-symbol-in-binary-after-go-build/68321542#68321542) – icza Aug 02 '21 at 07:04
  • @icza that seems to be the case. But when I disable inlining, the application using the plugin doesn't close and have to be killed. – TheOtherOne Aug 02 '21 at 11:35
  • Rebuild the main app and the plugin using the same options. – icza Aug 02 '21 at 11:39

0 Answers0