Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This document contains the list commits made for the LTO dump tool project for GCC under GSOC 2018.

LTO Dump Tool Project

The purpose of this dump tool is to analyze the LTO object files.

Link to Repository


The LTO object file is a regular elf file with sections containing LTO byte-code. A LTO object file contains various sections for storing command line options, symbol table, global declarations and types, function bodies in GIMPLE, call graph, etc. There are couple of limitations of the byte code format: 1] It is not self descriptive, which makes it harder to debug. 2] The byte code is essentially a “serialized” version of in-memory representations, which makes it prone to break across versions. The purpose of this project is to create a dump tool for easily analyzing LTO object files similar to readelf or objdump -d for regular elf object files.

Command line options added in the dumping infrastructure are:

Command Line option Function
-list Dumps list of details of functions and variables.
-demangle Dump the demangled output.
-defined-only Dump only the defined symbols.
-print-value Dump initial values of the variables.
-name-sort Sort the symbols alphabetically.
-size-sort Sort the symbols according to size.
-reverse-sort Dump the symbols in reverse order.
-no-sort Dump the symbols in order of occurence.
-symbol= Dump the details of specific symbol.
-objects= Dump the details of LTO objects.
-type-stats Dump the statistics of tree types.
-tree-stats Dump the statistics of trees.
-gimple-stats Dump the statistics of gimple statements.
-dump-level= For deciding the optimization level of body.
-dump-body= Dump the specific gimple body.
-help Display the dump tool help.

Links to commits:

Created seperate LTO dump tool.

Created command line option for dumping symbol list.

Created command line option for dumping detail information of specified symbol.

Created command line option for dumping details of LTO objects.

Created command line option for dumping tree type statistics.

Created command line option for dumping GIMPLE and TREE statistics.

Added command line options to dump specific optimized body of specified function.

Changes for refactoring.

Incorporated feedback part 1 and 2.

Incorporated feedback part 3 and 4.

lto_main comment added.

Documentation and corrections.

Improvements in documentation.

Improvements in refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment