The patch configure ELF header flags for MIPS target. For now the flags are hard coded. In fact they depends on ELF flags of input object files and selected emulation.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
ELF/Target.cpp | ||
---|---|---|
1257–1261 ↗ | (On Diff #43018) | Instead of assigning a value to ELFFlags member, can you move this code to getELFFlags and return a new value without assignment? |
ELF/Target.cpp | ||
---|---|---|
1257–1261 ↗ | (On Diff #43018) | Do you suggest to make the getELFFlags virtual or put if (Config->EMachine == EM_MIPS) into it? |
ELF/Target.cpp | ||
---|---|---|
1257–1261 ↗ | (On Diff #43018) | I have no strong preference, but maybe virtual? |
ELF/Target.cpp | ||
---|---|---|
1257–1261 ↗ | (On Diff #43018) | On second thought, this doesn't seem to have to belong this file. This can be written in Writer.cpp as a non-member function. Maybe that's better? |
Comment Actions
Simplify the code. Use a static function to get ELF flags. For now it is a good enough solution.
Comment Actions
LGTM with a nit.
ELF/Writer.cpp | ||
---|---|---|
1009–1017 | Can you return early? if (Config->EMachine != EM_MIPS) return 0; uint32_t V = EF_MIPS_ABI_O32 | ...; if (Config->Shared) return V | EF_MIPS_PIC; return V; |
Can you return early?