symtab in memory image

Vlastimil Masek rur@altavista.com
Fri Sep 29 07:31:00 GMT 2000


Hi

I am using crossgcc on cygwin for arm7 target. For
my application  it is desirable  that symbol table
and string table are loaded into memory along with
the  text,  rodata,...   like  in case  of  shared
objects (~DYNAMIC  segment).  I have  adjusted the
linker  script  so  that sections  *(.symtab)  and
*(.strtab)  should appear in  section "output_sym"
(see  bellow),  but it  has  always  zero size  no
matter where I put it.
Does anybody know how to achieve this?

Thank you.

Vlastimil

bash-2.04$ arm-elf-readelf -S app.exe
There are 19 section headers, starting at offset 0xfead8:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00       0   0 0
  [ 1] .debug_aranges    PROGBITS        00000000 013774 0014a8 00       0   0 1
  [ 2] .debug_pubnames   PROGBITS        00000000 014c1c 003367 00       0   0 1
  [ 3] .debug_info       PROGBITS        00000000 017f83 0c489e 00       0   0 1
  [ 4] .debug_abbrev     PROGBITS        00000000 0dc821 009c83 00       0   0 1
  [ 5] .debug_line       PROGBITS        00000000 0e64a4 018578 00       0   0 1
  [ 6] .rom_vectors      PROGBITS        0000c000 004000 000060 00 WAX   0   0 32
  [ 7] output_sym        PROGBITS        0000c060 0fea1c 000000 00   W   0   0 1
  [ 8] .text             PROGBITS        0000c060 004060 00ee0c 00  AX   0   0 4
  [ 9] .fini             PROGBITS        0001ae6c 0fea1c 000000 00   W   0   0 1
  [10] .rodata           PROGBITS        0001ae6c 012e6c 000414 00  WA   0   0 4
  [11] .rodata1          PROGBITS        0001b280 0fea1c 000000 00   W   0   0 1
  [12] .fixup            PROGBITS        0001b280 0fea1c 000000 00   W   0   0 1
  [13] .gcc_except_table PROGBITS        0001b280 0fea1c 000000 00   W   0   0 1
  [14] .data             PROGBITS        0001b280 013280 0004f4 00  WA   0   0 4
  [15] .bss              NOBITS          0001b774 013774 007a38 00  WA   0   0 16
  [16] .shstrtab         STRTAB          00000000 0fea1c 0000b9 00       0   0 1
  [17] .symtab           SYMTAB          00000000 0fedd0 0020d0 10      18  13 4
  [18] .strtab           STRTAB          00000000 100ea0 002f88 00       0   0 1
Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings)
              I (info), L (link order), O (extra OS processing required)
              o (os specific), p (processor specific) x (unknown)
bash-2.04$cat target.ld
STARTUP(vectors.o)
ENTRY(reset_vector)
INPUT(extras.o)
GROUP(libtarget.a libgcc.a)

MEMORY
{
    ram : ORIGIN = 0, LENGTH = 0x28000
}

SECTIONS
{
        .debug_aranges  0 : { *(.debug_aranges) } 
        .debug_pubnames 0 : { *(.debug_pubnames) } 
        .debug_info     0 : { *(.debug_info) } 
        .debug_abbrev   0 : { *(.debug_abbrev) } 
        .debug_line     0 : { *(.debug_line) } 
        .debug_frame    0 : { *(.debug_frame) } 
        .debug_str      0 : { *(.debug_str) } 
        .debug_loc      0 : { *(.debug_loc) } 
        .debug_macinfo  0 : { *(.debug_macinfo) } 
        __reserved_vectors = 0; 
        . = __reserved_vectors + 0x1000;
        __reserved_not_mapped = ALIGN (0x1); 
        . = __reserved_not_mapped + 0x7000;
        __reserved_for_rom = ALIGN (0x1); 
        . = __reserved_for_rom + 0x4000;
        .rom_vectors   ALIGN (0x4)  :      { . = . ; KEEP (*(.vectors)) } >  ram  

	output_sym : {
  			_symtab_start = ABSOLUTE(.); 
			*(.symtab*)
        		_symtab_end = ABSOLUTE(.);
			_strtab_start = ABSOLUTE(.); 
  			*(.strtab*)
			_strtab_end = ABSOLUTE(.);
	}  > ram

        .text   ALIGN (0x4)  :      { 
                stext = ABSOLUTE(.); PROVIDE (__stext = ABSOLUTE(.)); 
                *(.text*)
                *(.gnu.warning) 
                *(.gnu.linkonce*) 
                *(.init) *(.glue_7) 
                *(.glue_7t) 
        } >  ram  
        etext = .; PROVIDE (__etext = .); 
        .fini   ALIGN (0x4)  :      { . = . ; *(.fini) } >  ram  
        .rodata   ALIGN (0x4)  :      {	. = . ; *(.rodata*) } >  ram  
        .rodata1   ALIGN (0x4)  :      { . = . ; *(.rodata1) } >  ram  
        .fixup   ALIGN (0x4)  :      { . = . ; *(.fixup) } >  ram  
        .gcc_except_table   ALIGN (0x4)  :      { . = . ; *(.gcc_except_table) } >  ram  
        .data   ALIGN (0x4)  :      { 
                __ram_data_start = ABSOLUTE (.); 
                *(.data*) *(.data1)   
                _GOT1_START_ = ABSOLUTE (.); 
                *(.got1) 
                _GOT1_END_ = ABSOLUTE (.); 
                _GOT2_START_ = ABSOLUTE (.); 
                *(.got2) _GOT2_END_ = ABSOLUTE (.); 
                . = ALIGN (4); 
                __DEVTAB__ = ABSOLUTE (.); 
                KEEP (*(SORT (.devtab*))) 
                __DEVTAB_END__ = ABSOLUTE (.); 
                __NETDEVTAB__ = ABSOLUTE (.); 
                KEEP (*(SORT (.netdevtab*))) 
                __NETDEVTAB_END__ = ABSOLUTE (.); 
                __CTOR_LIST__ = ABSOLUTE (.); 
                KEEP (*(SORT (.ctors*))) 
                __CTOR_END__ = ABSOLUTE (.); 
                __DTOR_LIST__ = ABSOLUTE (.); 
                KEEP (*(SORT (.dtors*))) 
                __DTOR_END__ = ABSOLUTE (.); 
                *(.dynamic) 
                *(.sdata*) 
                *(.sbss*) 
        } >  ram  
        __rom_data_start = LOADADDR (.data); 
        __ram_data_end = .; PROVIDE (__ram_data_end = .); 
        _edata = .; PROVIDE (edata = .); 
        PROVIDE (__rom_data_end = LOADADDR (.data) + SIZEOF(.data)); 
        .bss   ALIGN (0x4)  :      { 
                __bss_start = ABSOLUTE (.); 
                *(.scommon) 
                *(.dynbss) 
                *(.bss*) 
                *(COMMON) 
                __bss_end = ABSOLUTE (.); 
        } >  ram
        . = ALIGN(4); 
        _end = .; PROVIDE (end = .); 
}


_______________________________________________________________________

Free Unlimited Internet Access! Try it now! 
http://www.zdnet.com/downloads/altavista/index.html

_______________________________________________________________________


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



More information about the crossgcc mailing list