delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/09/16/12:10:56

Message-ID: <35FFFE4E.F9739CD9@gmx.net>
Date: Wed, 16 Sep 1998 18:07:10 +0000
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Organization: none provided
MIME-Version: 1.0
To: Ilya Ryzhenkov <orangy AT inetlab DOT com>
CC: djgpp workers list <djgpp-workers AT delorie DOT com>
Subject: Re: Exceptions, linker and other ...
References: <35F16687 DOT 5C81F35E AT inetlab DOT com>

Ilya Ryzhenkov wrote :
> 
> 1. Exceptions. Where can I get information on how exceptions
> are handled internally ? They constantly crash my engine ...

Get the gcc sources, then look in the cp/ subdir in the files
"except.cc" which contains some information about it. Then take
the file "gxxint.texi" which describes the internals of gxx.
(probably a overlook, but the corresponding info file is missing
in the gpp28?b.zip :-( )

> goes to the same section, etc... Should I know all
> possible section names ? I need something like :
> SECTIONS {
>   * : { *(.*) }
> }

from ld 2.8 on, you can use wildcards in section names. I for instance
have in my linker script:

  .text  0x1000+SIZEOF_HEADERS : {
    *(.text)
    *(.ro*)
    *(.const*)
    etext  =  . ; _etext = .;
    . = ALIGN(0x200);
  }

which links all sections (beside .text) which start with .ro and .const
in the .text section.

> Btw, how gcc (ld?) decides when to stubify output ? By the
> output file suffix or whatever else ?

This is done in the specs file or in the special case
when linking directly with ld it is choosen from the output
format (coff-go32-exe: withe the stub prepended and
coff-go32: without stub)

> 3. Is their any tool, which can show the reason of including
> some .o from libc.a ? I.e. the symbol used, which require other, etc..

Add the "-Map foo.map" to your ld command-line and you will get
a map-file, which tells you, because of what a function what 
object-file is linked in.
(If you use gcc for linking, use "-Xlinker -Map -Xlinker foo.map")


BTW: It is probably much better for you, to get the newest
binutils and read there the ld docs, since they conatain all
of the tips above. I found them also only after reading it.

Robert
-- 
******************************************************
* email:   Robert Hoehne <robert DOT hoehne AT gmx DOT net>     *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************

- Raw text -


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