Hi!
I wanted to do some GCC hacking, as it seems there might still be some
hidden bugs in its current (trunk) version. So I installed NetBSD
(6.0.1) in SIMH and built trunk GCC with the system GCC (4.1.3).
This worked quite well and the driver itself works. However, `cc1',
the actual C compiler, does not:
root@simh-netbsd-1:/mnt/darkeye/src/linux/netbsd-install/bin# ./gcc ~/test.c
gcc: error trying to exec
'/mnt/darkeye/src/linux/netbsd-install/libexec/gcc/vax-unknown-netbsdelf6.0.1/4.8.0/cc1':
execv: Cannot allocate memory
I tried to run cc1 from within GDB, but that wasn't helpful either. As
there's no `strace', I guess that it's really execv() that's failing.
How do I debug this?
root@simh-netbsd-1:/mnt/darkeye/src/linux/netbsd-install/libexec/gcc/vax-unknown
-netbsdelf6.0.1/4.8.0# readelf -e ./cc1
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Digital VAX
Version: 0x1
Entry point address: 0xb3234
Start of program headers: 52 (bytes into file)
Start of section headers: 9464244 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 30
Section header string table index: 27
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 000100f4 0000f4 000017 00 A 0 0 1
[ 2] .note.netbsd.iden NOTE 0001010c 00010c 000018 00 A 0 0 4
[ 3] .note.netbsd.pax NOTE 00010124 000124 000014 00 A 0 0 4
[ 4] .hash HASH 00010138 000138 0119ac 04 A 5 0 4
[ 5] .dynsym DYNSYM 00021ae4 011ae4 026580 10 A 6 1 4
[ 6] .dynstr STRTAB 00048064 038064 062c3a 00 A 0 0 1
[ 7] .gnu.version VERSYM 000aac9e 09ac9e 004cb0 02 A 5 0 2
[ 8] .gnu.version_r VERNEED 000af950 09f950 000030 00 A 6 1 4
[ 9] .rela.dyn RELA 000af980 09f980 0027e4 0c A 5 0 4
[10] .rela.plt RELA 000b2164 0a2164 000858 0c A 5 12 4
[11] .init PROGBITS 000b29bc 0a29bc 000011 00 AX 0 0 2
[12] .plt PROGBITS 000b29d0 0a29d0 000864 0c AX 0 0 4
[13] .text PROGBITS 000b3234 0a3234 523024 00 AX 0 0 4
[14] .fini PROGBITS 005d6258 5c6258 00000a 00 AX 0 0 2
[15] .rodata PROGBITS 005d6264 5c6264 09f3f0 00 A 0 0 4
[16] .eh_frame PROGBITS 00675654 665654 27a678 00 A 0 0 4
[17] .ctors PROGBITS 008ffccc 8dfccc 00002c 00 WA 0 0 4
[18] .dtors PROGBITS 008ffcf8 8dfcf8 000008 00 WA 0 0 4
[19] .jcr PROGBITS 008ffd00 8dfd00 000004 00 WA 0 0 4
[20] .data.rel.ro PROGBITS 008ffd04 8dfd04 0204d4 00 WA 0 0 4
[21] .dynamic DYNAMIC 009201d8 9001d8 0000f8 08 WA 6 0 4
[22] .got PROGBITS 009202d0 9002d0 001014 04 WA 0 0 4
[23] .data PROGBITS 009212e4 9012e4 00552c 00 WA 0 0 4
[24] .bss NOBITS 00926810 906810 028f54 00 WA 0 0 4
[25] .comment PROGBITS 00000000 906810 000078 01 MS 0 0 1
[26] .ident PROGBITS 00000000 906888 000037 00 0 0 1
[27] .shstrtab STRTAB 00000000 9068bf 0000f3 00 0 0 1
[28] .symtab SYMTAB 00000000 906e64 08ad60 10 29 25727
4
[29] .strtab STRTAB 00000000 991bc4 1287e0 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00010034 0x00010034 0x000c0 0x000c0 R E 0x4
INTERP 0x0000f4 0x000100f4 0x000100f4 0x00017 0x00017 R 0x1
[Requesting program interpreter: /usr/libexec/ld.elf_so]
LOAD 0x000000 0x00010000 0x00010000 0x8dfccc 0x8dfccc R E 0x10000
LOAD 0x8dfccc 0x008ffccc 0x008ffccc 0x26b44 0x4fa98 RW 0x10000
DYNAMIC 0x9001d8 0x009201d8 0x009201d8 0x000f8 0x000f8 RW 0x4
NOTE 0x00010c 0x0001010c 0x0001010c 0x0002c 0x0002c R 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.netbsd.ident .note.netbsd.pax .hash .dynsym .dynstr
.gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata
.eh_frame
03 .ctors .dtors .jcr .data.rel.ro .dynamic .got .data .bss
04 .dynamic
05 .note.netbsd.ident .note.netbsd.pax
MfG, JBG
--
Jan-Benedict Glaw jbglaw%lug-owl.de@localhost
+49-172-7608481
Signature of: Gib Dein Bestes. Dann übertriff Dich selbst!
the second :
Attachment:
signature.asc
Description: Digital signature