* Re: ld in binutils-1.9l.3
[not found] <m0qetvm-00028iC@freya.yggdrasil.com>
@ 1994-08-28 17:02 ` H.J. Lu
1994-08-29 9:46 ` Ian Lance Taylor
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 1994-08-28 17:02 UTC (permalink / raw)
To: quinlan; +Cc: gas2
>
>
> This is a weird problem that `ld' should really detect and prevent
> (via a warning message).
>
> To reproduce:
>
> $ cat > test.c
> main () { printf("this is a test\n"); }
> ^D
> $ gcc -o test.o test.c (Note the missing "-c")
> $ file test.o
> test.o: Linux/i386 demand-paged executable (QMAGIC) not stripped
> $ gcc -o test test.o
> $ file test
> test: Linux/i386 demand-paged executable (QMAGIC) not stripped
> $ test.o
> this is a test
> $ test
> [ no output ]
>
> When this snuck up on us for real, it caused lots of problems and took
> a bit of debugging to track down a bad Makefile.
>
> Sometimes, they'll (twice linked binaries) run peacefully, but
> sometimes they do bad things: seg. fault (untraceable) and suck up all
> virtual memory are the two I've seen.
>
> Could some better magic detection be put into ld?
>
> - Dan
>
That is also true for the gas2 snapshot.
--
H.J. Lu
NYNEX Science and Technology, Inc. hjl@nynexst.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ld in binutils-1.9l.3
1994-08-28 17:02 ` ld in binutils-1.9l.3 H.J. Lu
@ 1994-08-29 9:46 ` Ian Lance Taylor
0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1994-08-29 9:46 UTC (permalink / raw)
To: hjl; +Cc: quinlan, gas2
From: hjl@nynexst.com (H.J. Lu)
Date: Sun, 28 Aug 94 20:02:06 EDT
> This is a weird problem that `ld' should really detect and prevent
> (via a warning message).
>
> To reproduce:
>
> $ cat > test.c
> main () { printf("this is a test\n"); }
> ^D
> $ gcc -o test.o test.c (Note the missing "-c")
> $ file test.o
> test.o: Linux/i386 demand-paged executable (QMAGIC) not stripped
> $ gcc -o test test.o
> $ file test
> test: Linux/i386 demand-paged executable (QMAGIC) not stripped
> $ test.o
> this is a test
> $ test
> [ no output ]
>
> When this snuck up on us for real, it caused lots of problems and took
> a bit of debugging to track down a bad Makefile.
>
> Sometimes, they'll (twice linked binaries) run peacefully, but
> sometimes they do bad things: seg. fault (untraceable) and suck up all
> virtual memory are the two I've seen.
>
> Could some better magic detection be put into ld?
I don't really see how to do this in a system independent fashion. On
some systems there is no simple way to distinguish files which are
reasonable linker inputs from files which are not.
Of course, I am open to suggestions.
Note that if you define a globally visible symbol in the crt0.o file,
then you will get a multiple definition error when you attempt to link
an already linked file. That should prevent this type of error from
occurring.
Ian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1994-08-29 9:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <m0qetvm-00028iC@freya.yggdrasil.com>
1994-08-28 17:02 ` ld in binutils-1.9l.3 H.J. Lu
1994-08-29 9:46 ` Ian Lance Taylor
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).