[PATCH] D41120: Compact symbols from 88 to 80 bytes

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 10:03:08 PST 2017


rafael created this revision.
rafael added reviewers: pcc, ruiu, grimar.
Herald added subscribers: javed.absar, sdardis, emaste.

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.


https://reviews.llvm.org/D41120

Files:
  ELF/AArch64ErrataFix.cpp
  ELF/Arch/Mips.cpp
  ELF/GdbIndex.cpp
  ELF/ICF.cpp
  ELF/InputSection.cpp
  ELF/LTO.cpp
  ELF/LinkerScript.cpp
  ELF/MapFile.cpp
  ELF/MarkLive.cpp
  ELF/Relocations.cpp
  ELF/SymbolTable.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  ELF/SyntheticSections.cpp
  ELF/Thunks.cpp
  ELF/Writer.cpp
  test/ELF/map-file.s
  test/ELF/relro-script.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41120.126566.patch
Type: text/x-patch
Size: 26946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/4906982f/attachment.bin>


More information about the llvm-commits mailing list