https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99530

            Bug ID: 99530
           Summary: [i386] 'P' inline assembly operand modifier should
                    obey -fno-plt
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago at kde dot org
  Target Milestone: ---

$ cat test.c
extern void f(void); 
void g() { asm("call %P0 ; asm" : : "X" (f)); } 
int h() { f(); return 0; }

The normal modes work:

$ gcc -fno-pic -S -o - -O2 test.c| grep call              
        call f ; asm
        call    f
$ gcc -fPIC -S -o - -O2 test.c| grep call              
        call f@PLT ; asm
        call    f@PLT

But the -fno-plt modes still generate PLT references:

$ gcc -fno-pic -fno-plt -S -o - -O2 test.c| grep call              
        call f ; asm
        call    *f@GOTPCREL(%rip)
$ gcc -fPIC -fno-plt -S -o - -O2 test.c| grep call              
        call f@PLT ; asm
        call    *f@GOTPCREL(%rip)

Reply via email to