This is the mail archive of the binutils@sourceware.org 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: mips multi-got error


ligang@sunnorth.com.cn wrote:



Hi all,


I am using mips ld to generate multi-got, but, it seems that ld can not
generate multi-got for ld
print a serial of "truncate..." error message. Is it a bug? or, is my usage
not correct?

as command line is : ./mips-linux-elf-as multi-got.s -KPIC -o multi-got.o
ld command line is : ./mips-linux-elf-ld multi-got.o

The test case is as follows:
===================================
.macro  one_sym count
        .globl  sym_1_\count
sym_1_\count:
        la      $2, sym_1_\count
        .endm

        .text
        .globl  func1
        .ent    func1
func1:
        .frame  $sp,0,$31
        .set noreorder
        .cpload $25
        .set reorder
        .cprestore 8
        .set noreorder

        .irp    milo,0,1
        .irp    thou,0,1,2,3,4,5,6,7,8
        .irp    hund,0,1,2,3,4,5,6,7,8,9
        .irp    tens,0,1,2,3,4,5,6,7,8,9
        .irp    ones,0,1,2,3,4,5,6,7,8,9
        one_sym \milo\thou\hund\tens\ones
        .endr
        .endr
        .endr
        .endr
        .endr
        .end    func1
=================================


Best regards Ligang


That is not supposed to work. Multi-got linking only works if there are fewer than 8192 symbols per compilation unit (input .o to the linker). See the multi-got-1 testcase in ld/testsuite/ld-mips-elf.


If you need more than 8192 symbols per compilation unit you must use -xgot for the assembler. Recent GCC versions have a -mxgot option that does the same thing for GCC.

David Daney.


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