delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/04/27/15:15:12

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Cc: <pavenis AT lanet DOT lv>, "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Subject: Re: ANNOUNCE: Binutils 2.11 released
Date: Fri, 27 Apr 2001 21:15:50 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIOENMCCAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-reply-to: <3028-Fri27Apr2001202824+0300-eliz@is.elta.co.il>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Are you sure?  Here's what I see in the assembly of a file whose name
> was passed to GCC as an absolute file name:
> 
> 	    .file	"command.c"
>     gcc2_compiled.:
>     ___gnu_compiled_c:
>     .stabs "d:/usr/djgpp/gnu/less-340/",100,0,0,Ltext0
>     .stabs "d:/usr/djgpp/gnu/less-340/command.c",100,0,0,Ltext0
> 
> and here's what I see for a file whose name was simply command.c:
> 
> 	    .file	"command.c"
>     gcc2_compiled.:
>     ___gnu_compiled_c:
>     .stabs "d:/usr/djgpp/gnu/less-340/",100,0,0,Ltext0
>     .stabs "command.c",100,0,0,Ltext0
> 
> To me, this looks like the first entry is the leading directory, while
> the second is supposed to be the basename.

Close - first is the current dir, second is the path passed.

With cwd=E:/Tmp, containing foo.c, I tried

gcc -S foo.c
gcc -S ../tmp/foo.c
gcc -S /tmp/foo.c
gcc -S e:/tmp/foo.c
gcc -S e:\tmp/foo.c
gcc -S e:\tmp\foo.c

In each case, the first entry was "e:/Tmp/", and the second the path
exactly as passed (with backslashes preserved).
objdump -g shows as filenames for the above:

E:/Tmp/foo.c
E:/Tmp/../tmp/foo.c
/tmp/foo.c
e:/tmp/foo.c
e:\tmp/foo.c
e:\tmp\foo.c

So I cannot reproduce the bug (either with my local cvs binutils, or Mark's
2.11 package)

In any case, using the basename would be wrong, as that would break debug
info for files compiled in a subdir (gcc -c foo/bar.c would produce a
reference to $CWD/bar.c instead of $CWD/foo/bar.c).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019