Question in powerpc-eabi-ld

David Cheon David.Cheon@eng.sun.com
Mon Nov 6 17:24:00 GMT 2000


Hi gcc experts,

I am currently using the powerpc-eabi-ld linker and found out that there is
a couple of issues on the linked object. 

Problem 1)

When linking objects using the following command:

powerpc-eabi-ld -EB -oformat elf32-powerpc -o ./bootloaderrom ./apl_init.o  
./apl_boot.o  ../common/common.o  ../common/mmucache.o  ./vpd.o  ./FPGACode1.o  
./FPGACode2.o \
        -T bootloader.ldi -t -X -N -Map bootloader.map
powerpc-eabi-ld: mode elf32ppc

and if bootloader.ldi is written as follows:

MEMORY
{
    rom : ORIGIN = 0xffc00000, LENGTH = 0x200000
    ram : ORIGIN = 0x00000000, LENGTH = 0x800000
}

SECTIONS {
  .text 0xffc00100 : { *(.text) }
  .rodata ADDR(.text)+SIZEOF(.text) : { *(.rodata) }
  .data1 0xffc04000 : { vpd.o (.data) }
  .data2 0xffc08000 : { FPGACode1.o (.data) }
  .data3 0xffd04000 : { FPGACode2.o (.data) }
  .data ADDR(.rodata)+SIZEOF(.rodata) : { *(.data) }
  .sbss 0x00080000 : { *(.sbss) }
  .sdata ADDR(.sbss)+SIZEOF(.sbss) : { *(.sdata) }
  .sdata2 ADDR(.sdata)+SIZEOF(.sdata) : { *(.sdata2) }
  .bss ADDR(.sdata2)+SIZEOF(.sdata2):  { *(.bss)  *(COMMON) }
}

My intention is to do the following:
- locate data section of vpd.o to       0xffc04000
- locate data section of FPGACode1.o to 0xffc08000
- locate data section of FPGACode2.o to 0xffd04000
- locate the rest of the data sections to follow FPGACode2.o in a 
  sequencial manner.

As shown in my bootloader.map file, the resulting object has duplicated 
.data sections (for vpd.o FPGACode1.o and FPGACode2.o). How should I edit 
the .ldi file in order to avoid such duplication ? 

.rodata         0xffc01894        0x0
 *(.rodata)

.data1          0xffc04000       0x34
 vpd.o(.data)
 .data          0xffc04000       0x34 vpd.o

.data2          0xffc08000    0x50bac
 FPGACode1.o(.data)
 .data          0xffc08000    0x50bac FPGACode1.o

.data3          0xffd04000       0x10
 FPGACode2.o(.data)
 .data          0xffd04000       0x10 FPGACode2.o

.data           0xffc01894    0x50c50
 *(.data)
 .data          0xffc01894       0x60 ../common/mmucache.o
 .data          0xffc018f4       0x34 ./vpd.o
 .data          0xffc01928    0x50bac ./FPGACode1.o
 .data          0xffc524d4       0x10 ./FPGACode2.o

.got            0xffc524e4       0x10
 .got           0xffc524e4       0x10 ./apl_init.o
                0xffc524e8                _GLOBAL_OFFSET_TABLE_

 

Problem 2)

The link also complains that it is missing the .got section (global offset
table). What is the global offset table and how it is used for ?

Here is the message from the linker:

powerpc-eabi-ld: warning: no memory region specified for section `.got'


I'm using gcc-2.95.2 and binutils-2.9.1

Thanks in advance for the help,

David




More information about the Gcc-help mailing list