LLD: Removing Native file format?

I think I bought up this topic before, but I’d like to propose seriously removing the Native file format from LLD this time.

IIUC, the Native file format was designed to be the fastest on-memory or on-disk file format for object files. The problem is that no one is working on that. No LLVM tools can produce object files in the Native, thus the feature of supporting the format is useless in the linker.

I’m also skeptical about the very idea of defining a new file format since existing file formats look to be good enough.

It’s maintenance cost is real. I needed to submit a few patches for the Native format for global refactoring.

Here I’m proposing removing the Native file format support from LLD unless there’s a person who’s going to take the ownership of the feature and push really hard to adopt the file format everywhere (not only in the linker).


I agree that we need to stop supporting the Native file format. Now it
is completely useless and just requires additional effort for
maintenance. If we decide to support it again in the future it will
not too hard to restore it.

With my FreeBSD hat on:
FreeBSD doesn't talk anything that's not ELF, it's already pretty
time-expensive implementing full support for that to even think about
a different format.
With my LLD hat on:
I've been slowed down from time to time because my patches didn't have
support for YAML or Native format. I personally would be very happy to
not have to worry about yet-another-different-format that at the time
of writing is just incomplete enough to be meaningful.


+1. If we ever decide we want to conspire between LLD and LLVM to use a fast custom object file format, we can try again with buy-in from LLVM MC contributors.

Yup, I was slowed down too. I think the situation was mitigated because I
removed the round-trip tests, which required us to serialize/de-serialize
intermediate linker results from/to on-disk files, but yeah, it's there
like tax. I'm not proposing removing YAML though, since it's useful for
writing tests. I want to stop supporting the Native.

I didn't either, because I see its usefulness. The same isn't true for
Native, alas. Sorry if it wasn't entirely clear from my previous mail.

I'm fine with it, we can add it back when lld is further along if needed.

- Michael Spencer

I sent a patch for review. I’ll wait for a while, probably submit that tomorrow.

I’m about to submit that patch. Final call.

Submitted as r234641.

Thanks for so significant clean up.