This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: the problem : assign the section's order in shared library based onmips platform



>That looks more or less right, although you have to be sure that _gp
>winds up properly aligned.
>
>What is the actual error from mips-elf-ld?

I check the source code(elfxx-mips.c). the error seems that ld have not
find .got.

now, i modify the linker script as below, it is ok ! and _gp have also been
verified !

OUTPUT_FORMAT("elf32-littlemips")
SECTIONS{
     . = ALIGN(16);
     .text : {*(.text) *(.text.*) *(.rodata)  }
     . = ALIGN(16);
     .data : {*(.data) *(.data.*)}
     . = ALIGN(16);
     .sdata : {*(.sdata) *(.sdata.*)}

     . = ALIGN(16); /* it must be larger than 16, otherwise _gp will have
offset unexpected ! */

     _gp = . + 0x7ff0;
     .got : {*(.got)}

     . = ALIGN(16);
     .sbss : {*(.sbss) *(.scommon)}
     . = ALIGN(16);
     .bss : { *(.bss) *(COMMON)}
     . = ALIGN(16);
     .rodata : {*(.rodata) *(.rodata.*)}
     . = ALIGN(16);
     .debug          0 : { *(.debug) }
     .line           0 : { *(.line) }
}


thank your reply !





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]