This adds assignAddressesScript method as separate one.
It is used when script is present.
Details
Diff Detail
Event Timeline
ELF/Writer.cpp | ||
---|---|---|
1417 | What is changed here in compare with assignAddresses() is:
|
The new code is mostly copy of the old code, so it would make the situation worse. The common part needs to be factored out instead of copying it.
ELF/Writer.cpp | ||
---|---|---|
1410–1420 | That abstract Script->getSectionVA(Sec->getName()) function we discussed earlier today not exist yet, no ? If we remove it now then all VA will be 0 ? Do you mean do that for now ? | |
1427–1429 | I know that is. Create one more method to move next code out ? // Add space for section headers. SectionHeaderOff = alignTo(FileOff, sizeof(uintX_t)); FileSize = SectionHeaderOff + getNumSections() * sizeof(Elf_Shdr); // Update "_end" and "end" symbols so that they // point to the end of the data segment. ElfSym<ELFT>::End.st_value = VA; I did not moved it out to assignPhdrs() because assignPhdrs is not a good name for that IMO. |
ELF/Writer.cpp | ||
---|---|---|
1410–1420 | You are not going to submit this without the other patches, right? I'd update this patch so that if I apply all patches to my local repository, I'd get the new code of the final form. | |
1427–1429 | Is there any way to move this piece of code to fixAbsoluteSymbols? I don't think the last address of the image is available only here. Also, not directly related to this patch, but the comment "they point to the end of the data segment" is incorrect. They point to the end of image in memory. |
What is changed here in compare with assignAddresses() is: