From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: neal@ctd.comsat.com Cc: egcs@cygnus.com Subject: Re: gcc doesn't pass stdout to ld? Date: Fri, 05 Dec 1997 09:20:00 -0000 Message-id: <199712051640.LAA23129@subrogation.cygnus.com> References: X-SW-Source: 1997-12/msg00310.html From: Neal Becker Date: Fri, 5 Dec 1997 10:53:37 -0500 With gcc-2.7.2, I used to do: /usr/local/m68k/m68k-unknown-coff/bin/gcc -m68000 -msoft-float -T flash.ld -o rcv -v apps/crt0.o apps/main.o apps/init.o apps/jumptbl.o version.o -Lapps -lapps -Lapi -lapi -Lscc -lscc -Lccube -lccube -Ldemod -ldemod -Lperipher -lperipher -Lrf -lrf -Llibgloss -lgloss -u main -lm -lc -lgloss -nostartfiles -Wl,-M > map To get a map file. It appears that egcs-1.0 doesn't pass the stdout to ld, because now the map is written not to the redirected "map", but to my terminal. Any reason for the change? A workaround? This is due to a change in collect2. I consider it to be a bug; it causes problems other than the one you mention. The bug is that tlink_execute redirects all linker output to both stdout and stderr into a file. It then examines the file, and writes it to stderr. The effect is that all output the linker sends to stdout gets redirected to stderr. The fix is presumably to redirect and examine stdout and stderr separately. One work around you can use is -Wl,-Map,map. Ian