As discussed on llvm-commits it was decided it would be best to check e_machine before declaring that a reserved section index is valid. The only special e_machine value that matters here is EM_HEXAGON. This change adds a special check for EM_HEXAGAON.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
tools/llvm-objcopy/Object.cpp | ||
---|---|---|
102 | This will work as written, but I think a different structure would better reflect what you're really doing. |
Comment Actions
Very true! I wasn't thinking about the fact that other architectures would reuse the same values.
Comment Actions
Would it be possible to add a test that shows that the special Hexagon types aren't valid for other targets, say x86?
This will work as written, but I think a different structure would better reflect what you're really doing.
That is, have a first switch for the common stuff, with no default.
Then do if (Machine == ...) switch ... for each set of machine-specific ones.
Then just return false at the end if no switch matched.
That will be right in the future when another machine has a different set that are actually the same numbers as SHN_HEXAGON_*.