delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/13/10:44:36

From: pavenis AT lanet DOT lv
To: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>,
djgpp-workers AT delorie DOT com
Date: Wed, 13 Jun 2001 17:44:22 +0300
MIME-Version: 1.0
Subject: Re: dxegen fails on object files built with gcc-3.0
Message-ID: <3B27A676.1211.FEF73C@localhost>
References: <200106130901 DOT f5D91vW03864 AT hal DOT astr DOT lu DOT lv>
In-reply-to: <Pine.LNX.4.10.10106131533070.2678-100000@acp3bf>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

On 13 Jun 2001, at 15:47, Hans-Bernhard Broeker wrote:

> On Wed, 13 Jun 2001, Andris Pavenis wrote:
> 
> > dxegen fails on object files built by gcc-3.0:
> > 
> > After invoking ld, dxegen reads simbols and misinterprets some items
> > as being unresolved external references
> > 
> > andris AT hal:/disk2/cvs/djgpp/build/djgpp/src/libemu/src$ i586-pc-msdosdjgpp-nm --demangle emu387.o  
> > 000084a0 b .bss
> > 000085f0 ? .comment
> 
> '?' indeed looks bad. Could this '.comment' be meant to be a section name,
> rather than a symbol? I ask because of this observation, on Linux/x86
> using gcc-2.95.2, binutils-2.9.1, and ELF binary format:

I took following simple source file:

#include <stdio.h>

int main (void)
{
   printf ("Hello\n");
   return 0;
}

and compiled it with gcc-3.0 20010610 for DJGPP (gcc -c -O2 -gstabs3 ...)

C:\temp>objdump --full-contents -j '.comment' hello.o

hello.o:     file format coff-go32

Contents of section .comment:
 07cb 4743433a 2028474e 55292033 2e302032  GCC: (GNU) 3.0 2
 07db 30303130 36313020 28707265 72656c65  0010610 (prerele
 07eb 61736529 00000000                    ase)....

-------  Output of 'objdump -x hello.o'  -----------

hello.o:     file format coff-go32
hello.o
architecture: i386, flags 0x00000031:
HAS_RELOC, HAS_SYMS, HAS_LOCALS
start address 0x00000000

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000030  00000000  00000000  00000104  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, CODE
  1 .data         00000000  00000030  00000030  00000000  2**4
                  ALLOC, LOAD, DATA
  2 .bss          00000000  00000030  00000030  00000000  2**2
                  ALLOC
  3 .stab         0000024c  00000030  00000030  00000134  2**2
                  CONTENTS, RELOC, DEBUGGING
  4 .stabstr      0000054f  0000027c  0000027c  00000380  2**0
                  CONTENTS, DEBUGGING
  5 .comment      00000028  000007cb  000007cb  000008cf  2**2
                  CONTENTS, DEBUGGING
SYMBOL TABLE:
[  0](sec -2)(fl 0x00)(ty   0)(scl 103) (nx 1) 0x00000000 hello.c
File 
[  2](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .text
AUX scnlen 0x30 nreloc 2 nlnno 0
[  4](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000030 .data
AUX scnlen 0x0 nreloc 0 nlnno 0
[  6](sec  3)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000030 .bss
AUX scnlen 0x0 nreloc 0 nlnno 0
[  8](sec  4)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000030 .stab
AUX scnlen 0x24c nreloc 4 nlnno 0
[ 10](sec  5)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x0000027c .stabstr
AUX scnlen 0x54f nreloc 0 nlnno 0
[ 12](sec  6)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x000007cb .comment
AUX scnlen 0x28 nreloc 0 nlnno 0
[ 14](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000010 _main
[ 15](sec  0)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 _puts


RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE 
00000017 dir32             .text
0000001c DISP32            _puts


RELOCATION RECORDS FOR [.stab]:
OFFSET   TYPE              VALUE 
00000014 dir32             .text
00000020 dir32             .text
000001f4 dir32             .text
00000248 dir32             .text

----------------  output of  'nm hello.o' ----------------

C:\temp>nm hello.o
00000030 b .bss
000007cb ? .comment
00000030 d .data
00000030 ? .stab
0000027c ? .stabstr
00000000 t .text
00000010 T _main
         U _puts

C:\temp>nm hello.o
00000030 b .bss
000007cb ? .comment
00000030 d .data
00000030 ? .stab
0000027c ? .stabstr
00000000 t .text
00000010 T _main
         U _puts

C:\temp>as --version
GNU assembler 2.11.90
Copyright 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i586-pc-msdosdjgpp'.

C:\temp>nm --version
GNU nm 2.11.90
Copyright 1997, 98, 99, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

(They are built from not modified 6 June CVS version of binutils. I have the same 
also with binutils-2.11)

Andris



- Raw text -


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