This is an archive of the discontinued LLVM Phabricator instance.

[ELF][MIPS] Handle section symbol points to the .MIPS.options / .reginfo section
ClosedPublic

Authored by atanasyan on May 26 2016, 9:41 AM.

Details

Summary

MIPS .reginfo and .MIPS.options sections are consumed by the linker, and the linker produces a single output section. But it is possible that input files contain section symbol points to the corresponding input section. In case of generation a relocatable output we need to write such symbols to the output file.

Fixes bug 27878.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 58636.May 26 2016, 9:41 AM
atanasyan retitled this revision from to [ELF][MIPS] Handle section symbol points to the .MIPS.options / .reginfo section.
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 subscribers: llvm-commits, emaste.
ruiu added inline comments.May 26 2016, 11:04 AM
ELF/InputSection.cpp
73–74 ↗(On Diff #58636)

Please use fatal instead of assert because this can be triggered by a broken user input. (use assert only for programmer's (i.e. our) errors.)

test/ELF/mips-options-r.test
12 ↗(On Diff #58636)

Can't you create it using llvm-as?

atanasyan updated this revision to Diff 58682.May 26 2016, 1:31 PM
  • Use fatal instead of assert
  • It is impossible to generate input file for the test case using llvm-mc because llvm-mc does not create section variable points to the .MIPS.options section.
ruiu accepted this revision.May 26 2016, 1:34 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 26 2016, 1:34 PM
This revision was automatically updated to reflect the committed changes.