$ cat c.c 
void blurb(void)
{
}
$ mips-linux-gcc -O2 -S -fno-pic -mno-abicalls c.c
$ cat c.s 
        .file   1 "c.c"
        .section .mdebug.abi32
        .previous
        .gnu_attribute 4, 1
        .text
        .align  2
        .globl  blurb
        .ent    blurb
        .type   blurb, @function
blurb:
        .set    nomips16
        .frame  $sp,0,$31               # vars= 0, regs= 0/0, args= 0, gp= 0
        .mask   0x00000000,0
        .fmask  0x00000000,0
        .set    noat
        move    $1,$31          # save current return address
        subu    $sp,$sp,8               # _mcount pops 2 words from  stack
        jal     _mcount
        .set    at
        j       $31
        .end    blurb
        .ident  "GCC: (GNU) 4.3.0"
$

This breaks loadable kernel modules on Linux where _mcount is defined in the
kernel itself thus outside the range of a jal instruction.


-- 
           Summary: -mlong-calls doesn't affect calls to _mcount generated
                    with -pg
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ralf at linux-mips dot org
GCC target triplet: mips*-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37593

Reply via email to