This is an archive of the discontinued LLVM Phabricator instance.

lld: Add -m elf32_x86_64
ClosedPublic

Authored by hjl.tools on Jul 12 2016, 10:22 AM.

Details

Summary

This patch adds -m elf32_x86_64 to lld. But it doesn't generate working
x32 binaries.

Diff Detail

Repository
rL LLVM

Event Timeline

hjl.tools updated this revision to Diff 63690.Jul 12 2016, 10:22 AM
hjl.tools retitled this revision from to lld: Add -m elf32_x86_64 .
hjl.tools updated this object.
hjl.tools added a reviewer: ruiu.
hjl.tools set the repository for this revision to rL LLVM.
hjl.tools added a project: lld.
hjl.tools added a subscriber: llvm-commits.
davide added a subscriber: davide.Jul 12 2016, 10:30 AM

LGTM modulo nit.
For the future, please upload a diff with context, so that we can review directly on phab.
svn diff --diff-cmd=diff -x-U50000 or git diff -U50000

Thanks for the patch!

ELF/Driver.cpp
73 ↗(On Diff #63690)

This is unsorted, maybe.

ruiu edited edge metadata.Jul 12 2016, 10:39 AM

Can you create working x32 executables with this patch? I expected a small change, but this is smaller than I imagined. For example, it would create PLTs exactly the same as the x86-64 ABI. I'm wondering if it was expected.

hjl.tools updated this revision to Diff 63744.Jul 12 2016, 4:02 PM
hjl.tools edited edge metadata.
hjl.tools removed rL LLVM as the repository for this revision.

This patches fixes PLTREL. But it doesn't generate working x32 binaries.

ruiu accepted this revision.Jul 12 2016, 4:05 PM
ruiu edited edge metadata.

LGTM, but please update the commit message to say that this is an initial patch for x32 and more work is needed to create working x32 binaries.

This revision is now accepted and ready to land.Jul 12 2016, 4:05 PM
hjl.tools updated this object.Jul 12 2016, 4:13 PM
hjl.tools edited edge metadata.
hjl.tools set the repository for this revision to rL LLVM.
This revision was automatically updated to reflect the committed changes.