gas with PIC and mips3

Sun Jun 4 20:30:00 GMT 2000

To  :
From: (Hideo Saito)
Title: Help me

Hello. My name is H.Saito.
I have a question, if possible, please show me a answer.
My OS is 4.3BSD UNIX.

I want to use gcc with PIC code, mips3  and big endian.
I assembled ttt.s program, and disassembled.
Why did gas use "ld" instruction at 40001c, 400030 and 400040?
If "ld" instruction is correct,
"_GLOBAL_OFFSET_TABLE_" should be made long word(64bits) data array.

% cat ttt.s
        .globl _start
        jal     xxx
        lw      $0,xxx
        sw      $0,yyy
% gas -o ttt.o ttt.s
ttt.s: Assembler messages:
ttt.s:6: Warning: No .cprestore pseudo-op used in PIC code
% gld -o ttt ttt.o
% objdump -D ttt

ttt:     file format elf32-bigmips

Disassembly of section .text:

0000000000400018 <_ftext>:
  400018:       00000000        nop

000000000040001c <test1>:
  40001c:       df998018        ld      $t9,-32744($gp)
  400020:       00000000        nop
  400024:       67390050        daddiu  $t9,$t9,80
  400028:       0320f809        jalr    $t9
  40002c:       00000000        nop

0000000000400030 <test2>:
  400030:       df818018        ld      $at,-32744($gp)
  400034:       00000000        nop
  400038:       64210050        daddiu  $at,$at,80
  40003c:       8c200000        lw      $zero,0($at)

0000000000400040 <test3>:
  400040:       df818018        ld      $at,-32744($gp)
  400044:       00000000        nop
  400048:       64210054        daddiu  $at,$at,84
  40004c:       ac200000        sw      $zero,0($at)

0000000000400050 <xxx>:
  400050:       00000000        nop

0000000000400054 <yyy>:
  400054:       00000000        nop
Disassembly of section .data:
Disassembly of section .got:

0000000000440060 <_GLOBAL_OFFSET_TABLE_>:
  440060:       00000000        nop
  440064:       80000000        lb      $zero,0($zero)
  440068:       00400000        0x400000
% gas --version
GNU assembler 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `mips64-elf'.

Thank you. Good bye.

More information about the Gcc-bugs mailing list