This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj][elf2yaml] - Add a support for the `EntSize` field for `SHT_HASH` sections.
ClosedPublic

Authored by grimar on Oct 1 2020, 6:40 AM.

Details

Summary

Specification for SHT_HASH table says (https://refspecs.linuxbase.org/elf/gabi4+/ch5.dynamic.html#hash)
that it contains Elf32_Word entries for both 32/64 bit objects.

Currently both GNU linkers and LLD sets the sh_entsize field to 4.

At the same time, yaml2obj ignores the EntSize field for SHT_HASH sections.
This patch fixes this and also adds a support for obj2yaml: it will not
dump this field when the sh_entsize contains the default value (4).

Diff Detail

Event Timeline

grimar created this revision.Oct 1 2020, 6:40 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar requested review of this revision.Oct 1 2020, 6:40 AM
MaskRay accepted this revision.Oct 1 2020, 2:34 PM

LGTM.

This revision is now accepted and ready to land.Oct 1 2020, 2:34 PM