This is an archive of the discontinued LLVM Phabricator instance.

lld: accept and ignore _fbsd suffix in emulation name
ClosedPublic

Authored by emaste on Mar 31 2016, 11:44 AM.

Diff Detail

Event Timeline

emaste updated this revision to Diff 52250.Mar 31 2016, 11:44 AM
emaste retitled this revision from to lld: accept elf_i386_fbsd as an alias for elf_i386.
emaste updated this object.
emaste added reviewers: ruiu, rafael, davide.
emaste added a subscriber: llvm-commits.
davide accepted this revision.Mar 31 2016, 11:46 AM
davide edited edge metadata.

This is good. Is it possible to add a testcase?

This revision is now accepted and ready to land.Mar 31 2016, 11:46 AM
ruiu accepted this revision.Mar 31 2016, 11:57 AM
ruiu edited edge metadata.

LGTM

ELF/Driver.cpp
59

This patch makes me wonder if we need "elf_x86_64_fbsd".

ruiu added a comment.Mar 31 2016, 11:58 AM

Or you can drop "_fbsd" by adding this piece of code at beginning of this function.

if (S.endswith("_fbsd"))
  S = S.drop_back(5);
emaste updated this revision to Diff 52255.Mar 31 2016, 12:12 PM
emaste retitled this revision from lld: accept elf_i386_fbsd as an alias for elf_i386 to lld: accept and ignore _fbsd suffix in emulation name.
emaste edited edge metadata.

just ignore _fbsd suffix as suggested by @ruiu

emaste requested a review of this revision.Mar 31 2016, 12:12 PM
emaste edited edge metadata.
ruiu added a subscriber: ruiu.Mar 31 2016, 12:20 PM

Just curious. Do you know the meaining of "_fbsd" suffix in other linkers?

In D18661#388529, @ruiu wrote:

Just curious. Do you know the meaining of "_fbsd" suffix in other linkers?

As far as I can tell it just sets the OS/ABI to FreeBSD. In practice all input ELF objects I've seen have the OS/ABI set already and lld just passes it through, so no special treatment is necessary.

davide accepted this revision.Mar 31 2016, 1:27 PM
davide edited edge metadata.
This revision is now accepted and ready to land.Mar 31 2016, 1:27 PM
ruiu accepted this revision.Mar 31 2016, 1:27 PM
ruiu edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.