This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf] - Do not omit a zero symbol value when printing relocations.
ClosedPublic

Authored by grimar on Jun 15 2020, 6:23 AM.

Details

Summary

Previously we only printed a symbol value when it has a non-empty name
or non-zero value.

This patch changes the behavior. Now we only omit a symbols value when
a relocation does not reference a symbol (i.e. symbol index == 0).

I think it is what GNU readelf does, looking on its output.
And such behavior looks much more reasonable to me.

Diff Detail

Event Timeline

grimar created this revision.Jun 15 2020, 6:23 AM
Herald added a project: Restricted Project. · View Herald Transcript

Note: reloc-zero-name-or-value.test was added in D59823. Seems it only documented the existent behavior.

jhenderson accepted this revision.Jun 16 2020, 2:10 AM

LGTM, if it is matching GNU.

This revision is now accepted and ready to land.Jun 16 2020, 2:10 AM
This revision was automatically updated to reflect the committed changes.