* Link Time Symbol Type Checking
@ 2016-01-01 0:00 Suprateeka R Hegde
0 siblings, 0 replies; only message in thread
From: Suprateeka R Hegde @ 2016-01-01 0:00 UTC (permalink / raw)
To: gnu-gabi
Hi
Can we make the GNU-gABI to say, something like:
"STT_FUNC iff function symbol"?
Context is https://goo.gl/cUvLMr
That means, if a language specification (C/C++/Fortran/etc) can detect a
reference as a function, and hence generates code accordingly, it is a
must for the tool chain to mark the UNDEF as of type STT_FUNC and not
STT_NOTYPE. And STT_NOTYPE to be used only when there is no clue from
any phase of the tool chain to detect the type.
May be something like:
"The type of an undefined symbol shall be the type of its expected
definition (if known) as per the language specification, otherwise
STT_NOTYPE is used."
On unix like HP-UX, we have link time symbol type checking for warnings
and diagnostics. This has indeed helped large sources with ambiguous
definitions (badly written code).
In my case, an enterprise application engineer had introduced a boolean
data variable "is_something_true" without knowing that there exists a
function also in the same name "is_something_true()". At link time, GCC
went through without warning and failed at runtime. The engineer who has
his app on all platforms, didnt have to debug as his HP-UX builds had
linktime warnings.
I thought it makes sense to improve GNU/GCC/Linux also with this.
--
Supra
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-05 7:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01 0:00 Link Time Symbol Type Checking Suprateeka R Hegde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).