[PATCH] D26977: [LLD][ARM] Add terminating sentinel .ARM.exidx table entry
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 22 09:49:33 PST 2016
ruiu added a comment.
Now that I'm not sure if that's the best way of doing it because as you mentioned that wouldn't work with linker scripts and might be too hacky. What if you implement it as a SyntheticSection? If you create a SyntehticSection for .ARM.exidx and add that to the end of Symtab<ELFT>::X->Sections, it should naturally be located to end of .ARM.exidx. Fortunately this is not a small feature, so it shouldn't be hard to write two implementations to compare.
================
Comment at: ELF/Writer.cpp:1509
+ uint8_t *Entry = Buf + Out->Size - 8;
+ write32le(Entry, 0);
+ Target->relocateOne(Entry, R_ARM_PREL31, S - P);
----------------
You could assume fresh file is filled with zeros.
================
Comment at: ELF/Writer.cpp:1540
+ OutputSectionBase *Sec = findSection(".ARM.exidx");
+ if (!Config->Relocatable && Sec) {
+ writeARMExidxSentinel(cast<OutputSection<ELFT>>(Sec), Buf + Sec->Offset);
----------------
nit: omit {} like five lines above.
https://reviews.llvm.org/D26977
More information about the llvm-commits
mailing list