0

I'm trying to get some simple assembler code on sparc32 running, but it does not write to standard output, the problem occurs either way with ta 0x00 or ta 0x08:

# as -s gah.s -o gah.o
# ld gah.o -o gah -lc
# ./gah
#
# truss ./gah
execve("./gah", 0xEFFFFE28, 0xEFFFFE30)  argc = 1
[..]
open("/usr/platform/SUNW,SPARCstation-20/lib/libc_psr.so.1", O_RDONLY) Err#2 ENOENT
close(3)                                        = 0
write(1, " H e l l o ,   W o r l d".., 14)      = 14
_exit(0)
# file gah
gah:            ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
# echo foo > /dev/fd/1
foo
# uname -a
SunOS foobar 5.6 Generic_105181-05 sun4m sparc SUNW,SPARCstation-20
gcc version 2.95.2 19991024 (release)

Could this be some linker related problem? I seem to see a write in the truss output.

dis Output: http://sprunge.us/hMXV

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Juergen
  • 351
  • 1
  • 2
  • 10
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). – John Saunders Nov 07 '12 at 23:08
  • ok, agreed, but why remove the code? – Juergen Nov 08 '12 at 15:28
  • I didn't remove any code. What do you mean? – John Saunders Nov 08 '12 at 18:24

1 Answers1

0

If you look under the covers, you'll see that stdout is just a standard file descriptor that refers to file descriptor number 1.

In other words, when you write to stdout, you'll see an OS call that points writes to file descriptor 1.

Gabe
  • 84,912
  • 12
  • 139
  • 238
  • This answer was probably a misunderstanding, as I know that 1 and stdout is the same. However, I didn't know, to explain my problem better. But thanks. – Juergen Nov 08 '12 at 15:30