Before this patch llvm-mc generated zlib-gnu styled sections.
That means no SHF_COMPRESSED flag was set, magic 'zlib' signature
was used in combination with full size field. Sections were renamed to "*.z*".
This patch reimplements the compression style to zlib one as zlib-gnu looks
to be depricated everywhere atm.
Details
- Reviewers
dblaikie davide • rafael - Commits
- rG68003e0fbf8b: Recommit r270070 ([llvm-mc] - Teach llvm-mc to generate compressed debug…
rGcf2bf9d0153c: Temporarily revert r270070
rG99c901fc4756: [llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.
rL270569: Recommit r270070 ([llvm-mc] - Teach llvm-mc to generate compressed debug…
rL270075: Temporarily revert r270070
rL270070: [llvm-mc] - Teach llvm-mc to generate compressed debug sections in zlib style.
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/MC/MCSectionELF.cpp | ||
---|---|---|
164 ↗ | (On Diff #57486) | I made Flags public because I need to add SHF_COMPRESSED flag to it. |
include/llvm/MC/MCSectionELF.h | ||
---|---|---|
65 ↗ | (On Diff #57486) | You can delete this one now. |
lib/MC/MCSectionELF.cpp | ||
---|---|---|
164 ↗ | (On Diff #57486) | ah, I changed getType, but I was thinking I am changing getFlag(). Thank you, I'll revisit this one ! |
- Addressed review comments.
include/llvm/MC/MCContext.h | ||
---|---|---|
388 ↗ | (On Diff #57486) | I fisrt time saw that code, but the fact of renaming something after giving it a name looked like a hack for me, I was also happy to do that :) |
include/llvm/MC/MCSectionELF.h | ||
65 ↗ | (On Diff #57486) | Done. |
lib/MC/ELFObjectWriter.cpp | ||
576 ↗ | (On Diff #57486) | Because Flags is a public member since now, please see below comment. |
1027 ↗ | (On Diff #57486) | wow, thanks for noticing. At fact the big endian should be used always for zlib-gnu style headers. But for zlib ones (this patch) elf file encoding should be used. I was sure that rule about big endian applies for both, even was not able to imaging a trap here. But there is a difference between styles, so for zlib style - target elf file endianess is a must, I updated the code. |
lib/MC/MCSectionELF.cpp | ||
164 ↗ | (On Diff #57486) | So i reverted this, it was a mistake change. |
- Updated patch, to write the forgotten type field.
- Also use header variables instead of c++ types (NFC, but looks better IMO).
lib/MC/ELFObjectWriter.cpp | ||
---|---|---|
576 ↗ | (On Diff #57614) | Please see my comment below. |
lib/MC/MCSectionELF.cpp | ||
162 ↗ | (On Diff #57614) | I am sorry but I find this and above change directly related since that changes are connected to what this patch do. |
lib/MC/ELFObjectWriter.cpp | ||
---|---|---|
576 ↗ | (On Diff #57614) | I saw your comment. There's no need to change at the same time the access control and remove the getter. Leave it private, and leave the getter to keep the patch small. You can do that in a separate commit. |
lib/MC/ELFObjectWriter.cpp | ||
---|---|---|
576 ↗ | (On Diff #57614) | Sorry but that means I need to intoduce setter to change Flags field ? // Set the compressed flag. That is zlib style. Section.Flags |= ELF::SHF_COMPRESSED; So do I correctly understand that you want me to create setter for this patch and remove it and getter in following commit ? what is the point for that ? May be let me just make Flags public at first ? |
1024 ↗ | (On Diff #57614) | will do. quick search shows that both way are used, but I would agree here. |
lib/MC/MCSectionELF.cpp | ||
---|---|---|
162 ↗ | (On Diff #57614) | Lets please do this first with just a getter and setter to make the patch easy to read. |
Had to temporaliry revert this, but also found another issue with landing, details are here: D20466
Working on that.