http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703

            Bug ID: 57703
           Summary: Assembler function definition moved to a different
                    ltrans then call
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin.liska at gmail dot com

SandboxSyscall calls SyscallAsm that is an assembler function defined in the
same file: syscall.cc.

dump grep:
grep SyscallAsm *:
out/Release/nacl_helper.ltrans1.047i.inline:call SyscallAsm
out/Release/nacl_helper.ltrans1.047i.inline:call SyscallAsm
out/Release/nacl_helper.ltrans0.s:.type SyscallAsm, @function
out/Release/nacl_helper.ltrans0.s:SyscallAsm:.cfi_startproc
out/Release/nacl_helper.ltrans0.s:9:.size SyscallAsm, 9b-SyscallAsm
out/Release/nacl_helper.ltrans1.s:call SyscallAsm
out/Release/nacl_helper.ltrans1.045i.cp:call SyscallAsm

Linker error:
nacl_helper.ltrans1.ltrans.o: In function `playground2::SandboxSyscall(int,
long, long, long, long, long, long)':
nacl_helper.ltrans1.o:(.text+0x4503): undefined reference to `SyscallAsm'
/home/marxin/gcc-mirror/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/ld:
nacl_helper.ltrans1.ltrans.o: relocation R_X86_64_PC32 against undefined symbol
`SyscallAsm' can not be used when making a shared object; recompile with -fPIC
/home/marxin/gcc-mirror/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/ld: final
link failed: Bad value
collect2: error: ld returned 1 exit status

Dumps link:
https://docs.google.com/file/d/0B0pisUJ80pO1eFltWU9NUUZkaGM/edit?usp=sharing

When compiled with --param lto-partitions=1 no problem is encountered.

Reply via email to