public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Suprateeka R Hegde <hegdesmailbox@gmail.com>
To: gnu-gabi@sourceware.org
Subject: Link Time Symbol Type Checking
Date: Fri, 01 Jan 2016 00:00:00 -0000	[thread overview]
Message-ID: <7707bbbf-fbc1-0356-f7d1-490700a259a2@gmail.com> (raw)

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

                 reply	other threads:[~2016-06-05  7:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7707bbbf-fbc1-0356-f7d1-490700a259a2@gmail.com \
    --to=hegdesmailbox@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).