This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/23912] New: Go binaries do not call __libc_start_main


https://sourceware.org/bugzilla/show_bug.cgi?id=23912

            Bug ID: 23912
           Summary: Go binaries do not call __libc_start_main
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

At least on x86-64, the Go linker is broken and does not link against crt1.o. 
Instead, the executable entry point looks like this:

0000000000459ad0 <_rt0_amd64_linux>:
  459ad0:       lea    0x8(%rsp),%rsi
  459ad5:       mov    (%rsp),%rdi
  459ad9:       lea    0x10(%rip),%rax        # 459af0 <main>
  459ae0:       jmpq   *%rax

And:

0000000000459af0 <main>:
  459af0:       lea    -0x3dd7(%rip),%rax        # 455d20 <runtime.rt0_go>
  459af7:       jmpq   *%rax

So the proper libc.so.6 initialization sequence is never used.

As a result, various glibc functionality will not work correctly.  We probably
need to take this into account when making future changes to __libc_start_main,
so that those broken Go binaries keep working.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]