There was a known limitation for -r option:
relocations against local symbols were not supported.
For example rel[a].eh_frame sections contained relocations against sections
and that was not supported for -r before. Patch fixes that.
Details
Diff Detail
Event Timeline
- Addressed review comments.
ELF/InputSection.cpp | ||
---|---|---|
139 | I dont like []. Problem is that [] operator creates and returns default value if there is no map entry. That can hide error, while accessing end iterator works like some kind of assert. | |
ELF/OutputSections.h | ||
245 | Fixed, btw I just used the same type as assigned to entries: |
LGTM
ELF/InputSection.cpp | ||
---|---|---|
139 | If it's a concern, you can add an assert here to check that the key always exists, but I think it is probably a bit too overly cautious. | |
ELF/OutputSections.h | ||
245 | Why I wrote that comment is because we have this piece of code in copyRelocations() and want to be consistent. uint32_t SymIndex = Rel.getSymbol(Config->Mips64EL); | |
ELF/Writer.cpp | ||
581 | Please guard this line with "if (Config->Relocatable)" |
ELF/Writer.cpp | ||
---|---|---|
581 | Done. I thought about something like that, because it is not reasonable to fill and use it for non-relocatable output. I guarded it with 'if' and updated a comment for Locals about that: // Local symbol -> ID, filled only when producing relocatable output. |
The value should always be available, right? So, you want to do
instead of using find.