I'm using g++ for Hitachi sh and h8 but....

Michael Svetlik m.svetlik@ssi-schaefer-peem.com
Tue Dec 10 04:20:00 GMT 2002

Hmmm ...

At the top of you map file, you should have a line, beginning with
'Archive member included because of file'
Below, there's a listing of modules, which require library resources. 
What does this block contain, in your environment ?

Fabio Giovagnini wrote:

>--no-whole-archive doesn't change anything.
>I think the stdc++ expects everything I see in the map file.
>Alle 11:43, martedì 10 dicembre 2002, Michael Svetlik ha scritto:
>>you explicitly tell ld, to link libraries into the output file:
>>-L$(SYSLIBDIR) -L$(LIBGCCDIR) -lstdc++ -lc -lgcc
>>In the map file, you can see their extension .a, so, those files are
>>static libs - the linker just does, what it's told to.
>>In the ld docs at
>>http://www.gnu.org/manual/ld-2.9.1/html_chapter/ld_2.html, you will find
>>a '--no-whole-archive' option - I'm not sure it will work, but for me it
>>seems so.
>>BTW: I've programmed those HITACHI H8 crutches for about five years -
>>you are sure you need to hack them in C++ ? We discarded this choice,
>>because of the amount of required resources ...
>>Fabio Giovagnini wrote:
>>>The following is a part of my map file:
>>>.text          0x0000afa0      0xfe0
>>>               0x0000b170
>>>               0x0000b310
>>>               0x0000afc0                __ZNSt9type_infoD1Ev
>>>               0x0000b120               
>>>__ZNKSt9type_info14__is_pointer_pEv 0x0000be30               
>>>               0x0000b200
>>>               0x0000b130               
>>>__ZNKSt9type_info15__is_function_pEv 0x0000ba60
>>>nfoEPKvRNS1_15__upcast_resultE 0x0000b3f0
>>>__class_type_infoES2_ 0x0000b0b0                __ZNSt10bad_typeidD0Ev
>>>               0x0000b070                __ZNSt10bad_typeidD2Ev
>>>               0x0000be58                __ZTVSt9type_info
>>>               0x0000b220
>>>               0x0000b090                __ZNSt10bad_typeidD1Ev
>>>               0x0000ba20
>>>resultE 0x0000b190
>>>               0x0000b140
>>>               0x0000bdac
>>>               0x0000bca0                ___dynamic_cast
>>>               0x0000b040                __ZNSt8bad_castD0Ev
>>>               0x0000b2c0
>>>               0x0000b250
>>>               0x0000b380
>>>_class_type_infoES2_ 0x0000b270
>>>               0x0000b0e0                __ZNKSt9type_infoeqERKS_
>>>               0x0000b540
>>>nfo10__sub_kindEPKS1_PKvS4_S6_RNS1_16__dyncast_resultE 0x0000be44         
>>>      __ZTVSt8bad_cast
>>>               0x0000b1b0
>>>               0x0000b290
>>>               0x0000b1e0
>>>               0x0000b160
>>>               0x0000b600
>>>info10__sub_kindEPKS1_PKvS4_S6_RNS1_16__dyncast_resultE 0x0000b020        
>>>       __ZNSt8bad_castD1Ev
>>>               0x0000afe0                __ZNSt9type_infoD0Ev
>>>               0x0000be04
>>>               0x0000b4d0
>>>PKvS3_S5_RNS0_16__dyncast_resultE 0x0000bdd8
>>>               0x0000bab0
>>>infoEPKvRNS1_15__upcast_resultE 0x0000b360
>>>               0x0000afa0                __ZNSt9type_infoD2Ev
>>>               0x0000b000                __ZNSt8bad_castD2Ev
>>>.text          0x0000bf80      0x170
>>>               0x0000bf80                ___cxa_bad_cast
>>>               0x0000c010                ___cxa_bad_typeid
>>>.text          0x0000c0f0       0xa0
>>>               0x0000c140                _sprintf
>>>               0x0000c0f0                __sprintf_r
>>>.text          0x0000c190       0xa0
>>>               0x0000c190                _strncpy
>>>.text          0x0000c230       0xa0
>>>               0x0000c230                _memcpy
>>>.text          0x0000c2d0       0xd0
>>>               0x0000c2d0                _strncmp
>>>.text          0x0000c3a0       0x70
>>>               0x0000c3a0                _strlen
>>>.text          0x0000c410       0x40
>>>               0x0000c410                _strcpy
>>>.text          0x0000c450       0x40
>>>               0x0000c470                _free
>>>               0x0000c450                _malloc
>>>.text          0x0000c490       0x10
>>>               0x0000c490                _write
>>>.text          0x0000c4a0       0x20
>>>               0x0000c4a0                _abort
>>>.text          0x0000c4c0       0x40
>>>               0x0000c4c0                _memset
>>>.text          0x0000c500       0x40
>>>               0x0000c500                _strcmp
>>>.text          0x0000c540     0x17f0
>>>               0x0000c6f0                __vfprintf_r
>>>               0x0000c600                _vfprintf
>>>.text          0x0000dd30       0x10
>>>.text          0x0000dd40      0x620
>>>               0x0000dec0                __malloc_r
>>>.text          0x0000e360      0x330
>>>               0x0000e5b0                __malloc_trim_r
>>>               0x0000e360                __free_r
>>>.text          0x0000e690      0x3b0
>>>               0x0000e810                __exit
>>>               0x0000e850                __getpid
>>>               0x0000e8d0                __utime
>>>               0x0000e6d0                __write
>>>               0x0000e690                __read
>>>               0x0000e7f0                __unlink
>>>               0x0000e7b0                __open
>>>               0x0000e870                __stat
>>>               0x0000e800                _isatty
>>>               0x0000e900                __wait
>>>               0x0000e830                __kill
>>>               0x0000e890                __chmod
>>>               0x0000e930                __execv
>>>               0x0000e910                __execve
>>>               0x0000e990                ___setup_argv_and_call_main
>>>               0x0000e970                __gettimeofday
>>>               0x0000e710                __link
>>>               0x0000e860                __raise
>>>               0x0000e7d0                __creat
>>>               0x0000e950                __pipe
>>>               0x0000e8b0                __chown
>>>               0x0000e6b0                __lseek
>>>               0x0000e6f0                __close
>>>               0x0000e960                __times
>>>               0x0000e7a0                __fstat
>>>               0x0000e8f0                __fork
>>>               0x0000e740                __sbrk
>>>.text          0x0000ea40      0x280
>>>               0x0000eb00                __raise_r
>>>               0x0000eca0                ___sigtramp
>>>               0x0000ec40                _raise
>>>               0x0000ec80                __init_signal
>>>               0x0000eba0                ___sigtramp_r
>>>               0x0000ec60                _signal
>>>               0x0000ea90                __signal_r
>>>               0x0000ea40                __init_signal_r
>>>.text          0x0000ecc0      0x2e0
>>>               0x0000ecc0                ___sfvwrite
>>>.text          0x0000efa0       0xf0
>>>               0x0000efa0                _fflush
>>>.text          0x0000f090      0x200
>>>               0x0000f130                _(short, float,  *)
>>>               0x0000f220                ___sinit
>>>               0x0000f200                __cleanup
>>>               0x0000f1e0                __cleanup_r
>>>               0x0000f0e0                ___sfmoreglue
>>>.text          0x0000f290       0xe0
>>>               0x0000f330                _setlocale
>>>               0x0000f2d0                __setlocale_r
>>>               0x0000f350                _localeconv
>>>               0x0000f320                __localeconv_r
>>>.text          0x0000f370       0x40
>>>               0x0000f370                __mbtowc_r
>>>.text          0x0000f3b0       0x30
>>>               0x0000f3b0                _isinf
>>>.text          0x0000f3e0       0x30
>>>               0x0000f3e0                _isnan
>>>.text          0x0000f410       0xc0
>>>               0x0000f410                _memchr
>>>.text          0x0000f4d0      0x100
>>>               0x0000f4d0                ___swsetup
>>>.text          0x0000f5d0     0x1310
>>>               0x0000f780                __dtoa_r
>>>.text          0x000108e0       0x40
>>>               0x000108e0                __sbrk_r
>>>.text          0x00010920       0x20
>>>               0x00010920                ___malloc_lock
>>>               0x00010930                ___malloc_unlock
>>>.text          0x00010940       0x20
>>>               0x00010940                ___trap34
>>>.text          0x00010960       0x50
>>>               0x000109a0                __getpid_r
>>>               0x00010960                __kill_r
>>>.text          0x000109b0       0xb0
>>>               0x000109b0                _memmove
>>>.text          0x00010a60       0x60
>>>               0x00010a60                __fwalk
>>>.text          0x00010ac0      0x150
>>>               0x00010b10                ___swrite
>>>               0x00010bf0                ___sclose
>>>               0x00010ac0                ___sread
>>>               0x00010b90                ___sseek
>>>.text          0x00010c10      0x120
>>>               0x00010c10                ___smakebuf
>>>.text          0x00010d30      0xcd0
>>>               0x000113e0                ___mcmp
>>>               0x00011800                __ratio
>>>               0x00011080                __i2b
>>>               0x000115c0                __b2d
>>>               0x00010e90                __s2b
>>>               0x00010f30                __hi0bits
>>>               0x00011220                __pow5mult
>>>               0x00011430                ___mdiff
>>>               0x00011300                __lshift
>>>               0x000110a0                __multiply
>>>               0x000116e0                __d2b
>>>               0x00010d30                __Balloc
>>>               0x00011974                ___mprec_tinytens
>>>               0x000119a0                __mprec_log10
>>>               0x0001194c                ___mprec_bigtens
>>>               0x00011530                __ulp
>>>               0x00010dc0                __Bfree
>>>               0x00011884                ___mprec_tens
>>>               0x00010fc0                __lo0bits
>>>               0x00010de0                __multadd
>>>are the syscalls a necessary requirement for stdc++ library?
>>>This is my final linker command
>>>ld_step : _arnmain_
>>>	$(LD) $(LFLAGS) -o $(OUTFILE) \
>>>	$(BASE_ARNSYS_DIR)/$(ARNSYS_DIR)/arch/arch.o \
>>>	$(BASE_ARNSYS_DIR)/$(ARNSYS_DIR)/system/system.o \
>>>	./arnMain/main.o \
>>>	-L$(SYSLIBDIR) -L$(LIBGCCDIR) -lstdc++ -lc -lgcc
>>>and my partial linker commands are:
>>>1) $(LD) -r -S -o arch.o  $(FILE_TO_LINK)
>>>2) $(LD) -r -S -o system.o  $(FILE_TO_LINK)
>>>Alle 10:27, martedì 10 dicembre 2002, Michael Svetlik ha scritto:
>>>>Are you sure, those linker tags _are_ syscalls? I assume, they are
>>>>compiler built-in's, so give him a -fno-builtin.
>>>>More informations about gcc and friends are here :
>>>>MS (not M$)
>>>>Fabio Giovagnini wrote:
>>>>>Hi everybody,
>>>>>as in the object, I'm using g++ for sh and h8 that are the uP we use for
>>>>>our boards. Because of we work in a very strict real time enviroment we
>>>>>can't use a general purpose os, so I wrote a simpel c++ application
>>>>>framework to improve the speed of my development. Every thing works
>>>>>fine, but if I analyze the map file, I can see all the posix system
>>>>>calls linked in, even if I don't implement the posix sys calls and I
>>>>>don't use them.
>>>>>Is there a linker or compiler option to turn off a set of standard c
>>>>>Want more information?  See the CrossGCC FAQ,
>>>>>http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to
>>>>Want more information?  See the CrossGCC FAQ,
>>>>http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to
>>Want more information?  See the CrossGCC FAQ,
>>http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to

Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

More information about the crossgcc mailing list