[Bug gas/10853] New: Relocations for ppc assembler apply to entire field argument

View: New views
4 Messages — Rating Filter:   Alert me  

[Bug gas/10853] New: Relocations for ppc assembler apply to entire field argument

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Given an assembly file like:

*** asm file ***
.global foo
lis 3, foo@h+4
****************

When I assemble and run objdump I get:

*** as/objdump output ***
$ as -o test.o test.s && objdump -Dr test.o                                                    

test.o:     file format elf32-powerpc
Disassembly of section .text:

00000000 <l1>:
   0:   3c 60 00 00     lis     r3,0
                        2: R_PPC_ADDR16_HI      foo+0x8
*************************

It appears that the relocation is being applied to the result of '<address of foo> + 0x8'.  My understanding
is that the immediate field of the 'lis' should have a value of 0x8 and the relocation should only apply to
'foo'.  The output I expect would look like:

*** expected as/objdump output ***
$ as -o test.o test.s && objdump -Dr test.o                                                    

test.o:     file format elf32-powerpc
Disassembly of section .text:

00000000 <l1>:
   0:   3c 60 00 08     lis     r3,8
                        2: R_PPC_ADDR16_HI      foo
**********************************

I'm using ubuntu jaunty ppc.  My binutils package is version '2.19.1-0ubuntu3'.  Is this a problem with my
understanding of how arguments in ppc assembly should be parsed, or in the way gas does assembly?

--
           Summary: Relocations for ppc assembler apply to entire field
                    argument
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: cconstantine at arxandefense dot com
                CC: bug-binutils at gnu dot org
  GCC host triplet: ppc-unknown-linux-gnu
GCC target triplet: ppc-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10853

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10853] Relocations for ppc assembler apply to entire field argument

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmrozek at arxandefense dot
                   |                            |com


http://sourceware.org/bugzilla/show_bug.cgi?id=10853

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10853] Relocations for ppc assembler apply to entire field argument

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From schwab at linux-m68k dot org  2009-10-27 20:08 -------
Powerpc uses RELA relocations where the addend is stored in the relocation
entry.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=10853

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug gas/10853] Relocations for ppc assembler apply to entire field argument

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From cconstantine at arxandefense dot com  2009-10-28 11:09 -------
Thanks for the quick clarification.

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10853

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils