public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
To: donn@interix.com
Cc: egcs@egcs.cygnus.com
Subject: Re: ISO C violation (really -- style & string pasting)
Date: Thu, 25 Mar 1999 14:26:00 -0000	[thread overview]
Message-ID: <199903252221.XAA00821@mira.isdn.cs.tu-berlin.de> (raw)
In-Reply-To: < 36FA5EC7.3144D054@interix.com > (message from Donn Terry on Thu,25 Mar 1999 09:05:27 -0700)

> Since the current uses of _GLOBAL_OFFSET_TABLE_ (which would
> NOT present a problem for, e.g., ELF) are hardcoded into literal
> strings in the compiler source (as part of instruction
> source lines), which in turn becomes part of the .s file,
> the symbol name needs to be changed in those strings,
> which becomes a preprocessor trick.

I see. If this is really a problem, why not just change the compiler?
Hacking with the preprocessor seems to produce more problems than it
solves. Consider

#define SHOW(x) printf(#x " is %d\n", x);

int main()
{
  int GLOBAL_OFFSET_TABLE_ = 1,
  SHOW(GLOBAL_OFFSET_TABLE_);
}

With your hack, you'd break this program.

Regards,
Martin

WARNING: multiple messages have this Message-ID
From: "Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de>
To: donn@interix.com
Cc: egcs@egcs.cygnus.com
Subject: Re: ISO C violation (really -- style & string pasting)
Date: Wed, 31 Mar 1999 23:46:00 -0000	[thread overview]
Message-ID: <199903252221.XAA00821@mira.isdn.cs.tu-berlin.de> (raw)
Message-ID: <19990331234600.MgVasy65DIhD-FiqiarFizqhVQWzGZBGcbT-jeb1NaU@z> (raw)
In-Reply-To: <36FA5EC7.3144D054@interix.com>

> Since the current uses of _GLOBAL_OFFSET_TABLE_ (which would
> NOT present a problem for, e.g., ELF) are hardcoded into literal
> strings in the compiler source (as part of instruction
> source lines), which in turn becomes part of the .s file,
> the symbol name needs to be changed in those strings,
> which becomes a preprocessor trick.

I see. If this is really a problem, why not just change the compiler?
Hacking with the preprocessor seems to produce more problems than it
solves. Consider

#define SHOW(x) printf(#x " is %d\n", x);

int main()
{
  int GLOBAL_OFFSET_TABLE_ = 1,
  SHOW(GLOBAL_OFFSET_TABLE_);
}

With your hack, you'd break this program.

Regards,
Martin

  parent reply	other threads:[~1999-03-25 14:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-24 16:38 Donn Terry
     [not found] ` < 36F9848A.9F566D1A@interix.com >
1999-03-24 23:35   ` Martin v. Loewis
1999-03-25  8:09     ` Donn Terry
     [not found]       ` < 36FA5EC7.3144D054@interix.com >
1999-03-25 14:26         ` Martin v. Loewis [this message]
1999-03-25 15:05           ` Donn Terry
1999-03-25 15:31             ` Martin v. Loewis
1999-03-31 23:46               ` Martin v. Loewis
1999-03-31 23:46             ` Donn Terry
1999-03-31 23:46           ` Martin v. Loewis
1999-03-31 23:46       ` Donn Terry
1999-03-31 23:46     ` Martin v. Loewis
1999-03-25 14:29   ` Richard Henderson
1999-03-25 14:51     ` Donn Terry
1999-03-25 15:07       ` Richard Henderson
1999-03-25 15:25         ` Donn Terry
1999-03-25 15:39           ` Jeffrey A Law
1999-03-31 23:46             ` Jeffrey A Law
1999-03-31 23:46           ` Donn Terry
1999-03-31 23:46         ` Richard Henderson
1999-03-31 23:46       ` Donn Terry
1999-03-25 15:14     ` espie
1999-03-25 15:35       ` Donn Terry
1999-03-31 23:46         ` Donn Terry
1999-03-31 23:46       ` espie
1999-03-25 15:36     ` Jeffrey A Law
1999-03-31 23:46       ` Jeffrey A Law
1999-03-31 23:46     ` Richard Henderson
1999-03-31 23:46 ` Donn Terry

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=199903252221.XAA00821@mira.isdn.cs.tu-berlin.de \
    --to=martin@mira.isdn.cs.tu-berlin.de \
    --cc=donn@interix.com \
    --cc=egcs@egcs.cygnus.com \
    /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).