This is the mail archive of the binutils@sourceware.cygnus.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]

difficulties with PIC and gas on MIPS platform



        I'm not sure whether I have a bug, or simply need a few clues thrown my
way. I'd bet on the latter. 8-) I've been working on bringing up
NetBSD/mips on our embedded platform. I've run into some issues when it
comes to profiling with -pg.

        NetBSD has definitions which adds code at the top of each .S file's
LEAF functions, which contains something like:

...
jal _mcount;
addiu sp,sp,-8;
...

        The idea being that the stack decrement occurs in the branch delay slot
for the jump op. This works -- until PIC comes in. It takes the jal and
replaces it with a five-line PIC/t9 something like:

lw      $t9,0($gp)
nop
jalr    $t9
nop
lw      $gp,16($sp)
addiu   $sp,$sp,-8

        Obviously, that ain't right anymore. The $sp adjustment is now well
after the jalr. ie. the PIC expansion doesn't appear to preserve the
delay slot contents.

        I'll readily admit to being a gcc/gas user, not developer. It also
means that I don't know the source base. I'm using 2.9.1, and it's a
cross-build environment.

        Thanks for any advice and suggestions!
        -- Ethan

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