Page MenuHomePhabricator

[lld-macho] Emit indirect symbol table
ClosedPublic

Authored by int3 on Sep 4 2020, 9:59 PM.

Details

Reviewers
gkm
Group Reviewers
Restricted Project
Commits
rG5d26bd3b7553: [lld-macho] Emit indirect symbol table
Summary

Makes it a little easier to read objdump's disassembly.

Diff Detail

Event Timeline

int3 created this revision.Sep 4 2020, 9:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2020, 9:59 PM
int3 requested review of this revision.Sep 4 2020, 9:59 PM
gkm accepted this revision.Sep 23 2020, 3:34 PM
gkm added a subscriber: gkm.

Very nice!

lld/MachO/OutputSection.h
66–67

Semantically blank names are beyond our reach in struct section_64, but class OutputSection is ours and we have the freedom to grant meaningful names. In writeTo() the assignments from members of OutputSection to section_64 will make it clear how the meaningful names map onto the meaningless names.

lld/MachO/SyntheticSections.h
396

English style nit.

This revision is now accepted and ready to land.Sep 23 2020, 3:34 PM
int3 added inline comments.Sep 23 2020, 3:44 PM
lld/MachO/OutputSection.h
66–67

It's not clear to me that reserved1 is *only* used to point to the indirect symbol table. Its semantics might be section-type-specific. That's why I didn't call it indirectSymtabOffset or something

int3 added inline comments.Sep 23 2020, 4:31 PM
lld/MachO/SyntheticSections.h
396

Aren't they the same thing? Accordingly to Grammarly:

Comprise is a verb that means “to be composed of.”

On second thought though it would be more accurate to say that "the indirect symbol table *is* a concatentation"

int3 updated this revision to Diff 293901.Sep 23 2020, 5:20 PM

grammar

gkm added inline comments.Sep 23 2020, 6:40 PM
lld/MachO/OutputSection.h
66–67

Ah, I see. OutputSection is very superclassy, so the reserved[12] members are just as generic as for section_64. My suggestion would be better suited to a subclass shared by GotSection, TlvPointerSection, and StubsSection.

lld/MachO/SyntheticSections.h
396

While Grammarly is technically correct (as are you), the nit I am picking is a matter of style.

This is the famous passage from Strunk & White's The Elements of Style (do you know it?):

Omit needless words.

Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts. This requires not that the writer make all his sentences short, or that he avoid all detail and treat his subjects only in outline, but that every word tell.

Many expressions in common use violate this principle:

the question as to whetherwhether
there is no doubt but thatno doubt (doubtless)
used for fuel purposesused for fuel
he is a man whohe
in a hasty mannerhastily
this is a subject whichthis subject
His story is a strange oneHis story is strange

In especial the expression the fact that should be revised out of every sentence in which it occurs.

owing to the fact thatsince (because)
in spite of the fact thatthough (although)
call your attention to the fact thatremind you (notify you)
I was unaware of the fact thatI was unaware that (did not know)
the fact that he had not succeededhis failure
the fact that I had arrivedmy arrival

... and your second thought is even better!

This revision was automatically updated to reflect the committed changes.