At 2018-08-22T11:46:30-0400, Perry E. Metzger wrote:
On Wed, 22 Aug 2018 11:29:40 -0400 Paul Winalski
<paul.winalski(a)gmail.com> wrote:
On 8/22/18, Perry E. Metzger
<perry(a)piermont.com> wrote:
To my knowledge, object file formats still don't have information
about type signatures, and linkers still don't care about types.
This is actually a problem. It would probably prevent a lot of
errors if those things changed.
For a linker to enforce (or warn about) type and call signature
matching, it would have to know the type and call semantics of each
particular language,
Not necessarily. One could produce a language-independent way of
signaling what the type signatures are (perhaps with normalized
language-dependent strings) and the linker could just check that they
match.
I've seen several languages (like OCaml) hack around the lack of this
by providing an auxiliary file for a pre-link phase to check off
of. It would be nicer if the linker could just handle that.
My impression is that Ada's .ali (I haven't seen an official mnemonic,
but "Ada Link Information" seems likely) files provide this security.
--
Regards,
Branden