This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Add initial MIPS support
ClosedPublic

Authored by atanasyan on Sep 28 2015, 2:36 PM.

Details

Summary

Besides a trivial MIPS support the patch introduces new TargetInfo class member getDefEntryName() to override default name of the entry symbol. MIPS uses __start for that.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 35910.Sep 28 2015, 2:36 PM
atanasyan retitled this revision from to [ELF2] Add initial MIPS support.
atanasyan updated this object.
atanasyan added reviewers: ruiu, rafael.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
ruiu accepted this revision.Sep 28 2015, 2:46 PM
ruiu edited edge metadata.

LGTM with a nit.

ELF/SymbolTable.cpp
50–51 ↗(On Diff #35910)

These cases need to be sorted by ASCIIbetical order, but yeah, that should be done in a different patch.

ELF/Target.h
38 ↗(On Diff #35910)

It's probably a matter of taste, but I'd name DefaultEntry instead of DefEntryName. (Because the linker mainly handles names, "name" tend to be added everywhere, so I wouldn't add that in the first place.)

This revision is now accepted and ready to land.Sep 28 2015, 2:46 PM
davide added a subscriber: davide.Sep 28 2015, 2:48 PM

This seems correct. Minor comments below.

ELF/Target.h
25 ↗(On Diff #35910)

Can we keep the getter sorted?

test/elf2/basic-mips.s
5 ↗(On Diff #35910)

Extra \n

8 ↗(On Diff #35910)

Can you please add a comment explaining what this test does (as we do on other archs)?

atanasyan marked 3 inline comments as done.Sep 28 2015, 3:15 PM
atanasyan added inline comments.
ELF/SymbolTable.cpp
50–51 ↗(On Diff #35910)

The case labels are sorted already. Do you want to sort them by xxxTargetInfo class names?

test/elf2/basic-mips.s
5 ↗(On Diff #35910)

I think it is better to separate "running" instructions (RUN) from "configuration" instructions (REQUIRES).

ruiu added inline comments.Sep 28 2015, 3:18 PM
ELF/SymbolTable.cpp
50–51 ↗(On Diff #35910)

Ah, I didn't notice that. We are using different names for valid reasons (386TargetInfo is not even a valid name!) Thank you for pointing that out.

This revision was automatically updated to reflect the committed changes.