This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Fix assembler so that it maches description
AbandonedPublic

Authored by davide on Sep 24 2015, 10:30 AM.

Details

Reviewers
rafael
Summary

I tried to run basic.s on my machine and noticed it crashes. I tracked with truss(1) and realized it's actually trying to execute the wrong system call.

% truss ./basic
Segmentation fault (core dumped)
davide@rabbit1:/exps/llvm-lld/tools/lld/test/elf2 % objdump
davide@rabbit1:/exps/llvm-lld/tools/lld/test/elf2 % truss ./basic
umask(0x2a,0x0,0x0,0x0,0x0,0x0) = 18 (0x12)
SIGNAL 11 (SIGSEGV)
process exit, rval = 0

POSIX doesn't know about syscall numbers (or in general system calls), so this code is inherently unportable In reality, it's fairly unlikely somebody assigns '1' to something different than exit() so we should be able to run this code on several UNIXes even if it was written with Linux as target.

Diff Detail

Event Timeline

davide updated this revision to Diff 35650.Sep 24 2015, 10:30 AM
davide retitled this revision from to [ELF2] Fix assembler so that it maches description.
davide updated this object.
davide added a reviewer: rafael.
davide set the repository for this revision to rL LLVM.
davide added a subscriber: llvm-commits.
emaste added a subscriber: emaste.Sep 24 2015, 12:40 PM

what's 60 on Linux?

davide abandoned this revision.Sep 24 2015, 1:08 PM