This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Implement SHT_SYMTAB_SHNDX (.symtab_shndxr) section.
ClosedPublic

Authored by grimar on Jul 19 2018, 5:42 AM.

Details

Summary

This is relative to https://bugs.llvm.org//show_bug.cgi?id=38119.

SHT_SYMTAB section is able to keep symbols with output section indices up to 0xff00 (SHN_LORESERVE).
But if we have indices that are greater than that (PR shows that it might happen), we need to use
SHT_SYMTAB_SHNDX extended section. It was not supported by LLD.

Description of the SHT_SYMTAB_SHNDX section is here:
https://docs.oracle.com/cd/E19683-01/817-3677/chapter6-94076/index.html.

Diff Detail

Event Timeline

grimar created this revision.Jul 19 2018, 5:42 AM
ruiu accepted this revision.Jul 20 2018, 3:46 PM

LGTM

ELF/SyntheticSections.cpp
1921

You are not using CommonSec.

ELF/SyntheticSections.h
591

I'd name this SymtabShndxSection for consistency with the name of the section.

This revision is now accepted and ready to land.Jul 20 2018, 3:46 PM
This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.