GNU as and assembler listing and -pipe and gcc!!!...

Steffen Dettmer steffen.dettmer@googlemail.com
Wed May 11 10:30:00 GMT 2011


* On Wed, May 11, 2011 at 11:12 AM, ali hagigat <hagigatali@gmail.com> wrote:
> Note if the assembler source is coming from the standard input
> (eg because it is being created by gcc and the ‘-pipe’ command
> line switch is being used) then the listing will not contain
> any comments or preprocessor directives. This is because the
> listing code buffers input source lines from stdin only after
> they have been preprocessed by the assembler. This reduces
> memory usage and makes the code more efficient.
> ------------------------------
> I have copied part of the as manual in the above.
>
> What is the relationship of the standard input, -pipe, gcc and as?

I'm sure it is exactly as documented above: gcc -pipe creates
standard input for as, like "cc | as".

> Please give a clear example for this part of GNU "as" manual.

$ gcc -pipe hello.c

saves a temp file:

$ strace -e open -oo1 gcc hello.c
$ strace -e open -oo2 gcc -pipe hello.c
$ diff -U 0 o1 o2
--- o1  2011-05-11 12:26:42.000000000 +0200
+++ o2  2011-05-11 12:26:45.000000000 +0200
@@ -9 +9 @@
-open("/tmp/cc0IkkR0.s", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
+open("/tmp/cc83NG1i.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
@@ -11 +10,0 @@
-open("/tmp/ccqiGQYT.o", O_RDWR|O_CREAT|O_EXCL, 0600) = 3


oki,

Steffen



More information about the Binutils mailing list