Skip to content

Conversation

MaxDesiatov
Copy link
Contributor

These terms are frequently referenced in Swift source code and comments. Having at least basic definitions for them in Lexicon.md should lower the barrier for new contributors.

@MaxDesiatov MaxDesiatov requested review from compnerd and CodaFi March 5, 2022 15:30
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that concerns me about this is that it can grow uncontrolled. Each platform has its own lexicon for this. Toolchain can use different lexicon as well. These terms aren't Swift specific, but are general toolchain terms. Do we intend to document all principles of toolchain work?

docs/Lexicon.md Outdated

Dynamic shared object, an object file to be used by multiple applications
while they are executing. Dynamically linked libraries are implemented with
DSOs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DSO is the .so/.dylib/.dll itself, not the object files that are used.

docs/Lexicon.md Outdated
a section in an executable or a shared library, which enables code to run
independently of the memory address where it is loaded at runtime. Entries
in GOT directly point to absolute addresses of symbols. The format of GOT
is platform-dependent. Dynamic linkers update GOT relocations either on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer loader to dynamic linker.

docs/Lexicon.md Outdated

Procedure linkage table, which is used to call external functions that don't
have their addresses known at link time. These addresses are then resolved
by a dynamic linker at run time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar

These terms are frequently referenced in Swift source code and comments. Having at least basic definitions for them in `Lexicon.md` should lower the barrier for new contributors.
@MaxDesiatov
Copy link
Contributor Author

One thing that concerns me about this is that it can grow uncontrolled. Each platform has its own lexicon for this. Toolchain can use different lexicon as well. These terms aren't Swift specific, but are general toolchain terms. Do we intend to document all principles of toolchain work?

I personally don't intend to document all of them, but only those that I personally found hard to piece together, especially abbreviations. These three abbreviations are used extensively in the codebase and comments. It took me some time to understand their meaning and context in which they're used.

I don't know the original intention of the author of this file, but it looks like a precedent has been established with a lot of terms specified in this document not specific to Swift itself.

@MaxDesiatov MaxDesiatov requested a review from compnerd March 5, 2022 17:04
@CodaFi
Copy link
Contributor

CodaFi commented Mar 16, 2022

Perhaps we ought to refine/scope these entries to their usages in the project. For example, IRGen makes heavy usage of "GOT" as in "GOT-equivalent variable" to describe the way it forms references to global objects that may or may not be external references. We can also cross reference resources like the LLVM langref if need be (for example, they provide a pragmatic explanation of DSO local variables).

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit b395c72 into main Jun 22, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/dso-got-plt branch June 22, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants