[LLVMbugs] [Bug 4293] New: PIC is broken on ppc32-linux

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jun 1 11:46:46 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4293

           Summary: PIC is broken on ppc32-linux
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: PowerPC
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3049)
 --> (http://llvm.org/bugs/attachment.cgi?id=3049)
testcase

This is the source of the one "make check" failure on ppc32-linux. Bugpoint
runs llc -relocation-model=pic and that breaks the reduction of
test/BugPoint/misopt-basictest.ll.

$ Debug/bin/llc -reloaction-model=pic x.bc -f -o x.s
$ gcc x.s -o x.exe
x.s: Assembler messages:
x.s:14: Error: bad expression
x.s:14: Error: syntax error; found `L' but expected `,'
x.s:14: Error: junk at end of line: `L1$pb"@ha'
x.s:14: Error: bad expression
x.s:14: Error: syntax error; found `L' but expected `('
x.s:14: Error: junk at end of line: `L1$pb"@l(3)'

The problem is these:
  lis 3, .LC0-"L1$pb"@ha
  la 3, .LC0-"L1$pb"@l(3)
which probably would work fine if only "L1$pb" were defined anywhere in the .s
file.

By contrast the .s generated by gcc -fPIC looks like:

[...]
  .section ".got2","aw"
.LCTOC1 = .+32768
  .section ".text"
  .section ".got2","aw"
.LC1:
  .long .LC0
[... later on in main]
  addis 30,30,.LCTOC1-.LCF0 at ha
  addi 30,30,.LCTOC1-.LCF0 at l
  lwz 3,.LC1-.LCTOC1(30)
  bl puts+32768 at plt
[... def'n of .LC0 same as llvm's .s]

or with gcc -fpic:

[... no def'n of .LCTOC1 or .LC1]
  addis 30,30,_GLOBAL_OFFSET_TABLE_-.LCF0 at ha
  addi 30,30,_GLOBAL_OFFSET_TABLE_-.LCF0 at l
  lwz 3,.LC0 at got(30)
  bl puts at plt
[... def'n of .LC0 below]


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list