This is an archive of the discontinued LLVM Phabricator instance.

Compact symbols from 88 to 80 bytes
Needs ReviewPublic

Authored by espindola on Dec 12 2017, 10:03 AM.

Details

Reviewers
pcc
ruiu
grimar
Summary

This started by me noticing that shared symbols that are subject to a copy relocation look like a plain Defined symbol: they are defined in the .bss section and that is the only reason why SharedSymbols have a section.

I first tried to implement copy relocations by replacing the shared symbol with a Defined. This hits the issue of Defined not having a version definition. We could move Verdefindex to the base class, but that seems a bit odd.

What this patch does instead is move the Section to the base class and merge it with the file pointer. This reduces the size of both SharedSymbol and Defined. When there is a Section the file can be found by following the Section pointer.

A side effect is that copy relocation sections show up as being from the original .so. I actually like the map format change, but I can add logic to keep the old format if desired.

Diff Detail

Event Timeline

rafael created this revision.Dec 12 2017, 10:03 AM
ruiu added a comment.Dec 12 2017, 12:40 PM

How much do you gain by this change? This is I think undeniably a bit tricky, so if the difference is negligible, I wouldn't make this change. I actually tried to do a similar thing but decided not to do that in the end to keep these classes simple.

espindola commandeered this revision.Mar 15 2018, 8:46 AM
espindola added a reviewer: rafael.