Dynamically and statically linked symbols
Closed this issue · 1 comments
as
(the GNU assembler) resolves whether procedures are statically or dynamically linked with some annotations.
Statically linked procedures are just imported in the scope with .extern <procedure_name>
, while dynamically linked procedures must be refered to as offsets of either the PLT (Procedure Linkage Table) or the GOT (Global Offset Table).
This solution really shows the inner mecanisms of the name resolution, but is a bit hard to understand, and to directly use in an assembly language.
I plan on using special directives (static <procedure>: <type>
and dynamic <procedure>: <type>
) to abstract away all the details about the .plt
, .got.plt
, .plt.got
, .rel(a).dyn
and .rel(a).text
sections for easier use of the language. Those mecanisms will be hidden in the compiler and all the necessary sections will be generated at compile-time, if needed.