Page MenuHomePhabricator

[ELF][MIPS] MIPS .reginfo sections handling
ClosedPublic

Authored by atanasyan on Dec 19 2015, 12:28 PM.

Details

Summary

MIPS .reginfo section provides information on the registers used by the code in the object file. Linker should collect this information and write a single .reginfo section in the output file. This section contains a union of used registers masks taken from input .reginfo sections and final value of the _gp symbol.

For details see the "Register Information" section in Chapter 4 in the following document:
ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf

The patch implements .reginfo sections handling with a couple missed features: a) it does not put output .reginfo section into the separate REGINFO segment; b) it does not merge ri_cprmask masks from input section. These features will be implemented later.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 43309.Dec 19 2015, 12:28 PM
atanasyan retitled this revision from to [ELF][MIPS] MIPS .reginfo sections handling.
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 added inline comments.Dec 19 2015, 7:09 PM
ELF/InputSection.cpp
335 ↗(On Diff #43309)

error() is a _NoReturn function, so you don't need this return 0.

ELF/InputSection.h
164 ↗(On Diff #43309)

I think this is a good place to write about MIPS Reginfo as you wrote in the patch description.

170 ↗(On Diff #43309)

Can you move this just below the above typedef?

atanasyan updated this revision to Diff 43315.Dec 19 2015, 8:45 PM
  • Remove return after NoReturn function
  • Keep typedefs in a single code block
  • Rewrite comment for the MipsReginfoInputSection class
ruiu accepted this revision.Dec 19 2015, 9:08 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 19 2015, 9:08 PM
This revision was automatically updated to reflect the committed changes.