public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: hjl@innovix.com (H.J. Lu)
To: nik@tiuk.ti.com (Nick Ing-Simmons)
Cc: rh@unifix.de, drepper@cygnus.com, rms@gnu.ai.mit.edu, dm@sgi.com,
	wilson@cygnus.com, gas2@cygnus.com, gcc2@cygnus.com,
	ian@cygnus.com
Subject: Re: global vars and symbol visibility for mips32/elf
Date: Thu, 15 Aug 1996 11:24:00 -0000	[thread overview]
Message-ID: <m0ur70n-0000WQC@eric.innovix.com> (raw)
In-Reply-To: <199608140716.IAA28416@pluto>

> 
> Ruediger Helsch <rh@unifix.de> writes:
> >But the standard allows such behaviour only if no strictly 
> >standard-conforming program is broken by the extension.  The following
> >program is strictly conforming and should continue to run:
> >
> >	#include <assert.h>
> >	int optind[30000], optarg[30000];
> >
> >	main()
> >	{
> >		int i;
> >		for (i = 0; i < 30000; i++) {
> >			optind[i] = 1;
> >			optarg[i] = 2;
> >		}
> >
> >		for (i = 0; i < 30000; i++) {
> >			assert(optind[i] == 1);
> >			assert(optarg[i] == 2);
> >		}
> >		return 0;
> >	}
> >
> >Try this to see whether your compiler conforms to the C standard!
> >
> FWIW - gcc-2.7.2 (using /usr/ccs/bin/ld) , Solaris 2.5 
> 
> gcc     x.c   -o x
> ld: warning: symbol `optind' has differing sizes:
> 	(file /var/tmp/cca006vl1.o value=0x1d4c0; file /usr/lib/libc.so value=0x4);
> 	/usr/lib/libc.so definition taken
> ld: warning: symbol `optarg' has differing sizes:
> 	(file /var/tmp/cca006vl1.o value=0x1d4c0; file /usr/lib/libc.so value=0x4);
> 	/usr/lib/libc.so definition taken
> pluto 5% x
> Segmentation Fault (core dumped)
> 
> Identical results with SunPro cc ...
> 
> 

On Linux, I got

# gcc foo.c
usr/i486-linux/bin/ld: Warning: size of symbol `optarg' changed from 120000 to 4 in /usr/lib/libc.so
/usr/i486-linux/bin/ld: Warning: size of symbol `optind' changed from 120000 to 4 in /usr/lib/libc.so 
# a.out
zsh: 19888 segmentation fault  ./a.out


-- 
H.J. Lu
Innovix Technologies, Inc.
hjl@innovix.com

  parent reply	other threads:[~1996-08-15 11:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-09  2:46 David S. Miller
1996-08-09  5:24 ` David S. Miller
1996-08-09  9:01   ` Ian Lance Taylor
1996-08-09  8:30 ` Ian Lance Taylor
1996-08-09 13:13   ` Ulrich Drepper
1996-08-09 15:30     ` Ian Lance Taylor
1996-08-10 17:37       ` Richard Stallman
1996-08-10 19:41         ` Ian Lance Taylor
1996-08-10 23:26           ` Jim Wilson
1996-08-11  1:44           ` Richard Stallman
1996-08-13 10:58           ` Ruediger Helsch
1996-08-13 13:36             ` Jim Wilson
1996-08-13 16:06               ` Ruediger Helsch
1996-08-13 19:04                 ` Jim Wilson
1996-08-13 21:02                   ` Richard Stallman
1996-08-14  3:06                     ` Ruediger Helsch
1996-08-14 23:44                       ` Richard Stallman
1996-08-14  0:18                 ` Nick Ing-Simmons
1996-08-14  3:06                   ` Ruediger Helsch
1996-08-15 11:24                   ` H.J. Lu [this message]
1996-08-13  9:06 ` Ruediger Helsch
1996-08-13 10:58   ` Richard Stallman
1996-08-13 13:36     ` Ruediger Helsch
1996-08-13 13:36       ` Richard Stallman
1996-08-13 14:40       ` H.J. Lu
1996-08-13 16:06       ` Ulrich Drepper
1996-08-13 16:06         ` Joe Buck
1996-08-13 17:02         ` Rohan LENARD

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=m0ur70n-0000WQC@eric.innovix.com \
    --to=hjl@innovix.com \
    --cc=dm@sgi.com \
    --cc=drepper@cygnus.com \
    --cc=gas2@cygnus.com \
    --cc=gcc2@cygnus.com \
    --cc=ian@cygnus.com \
    --cc=nik@tiuk.ti.com \
    --cc=rh@unifix.de \
    --cc=rms@gnu.ai.mit.edu \
    --cc=wilson@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).