Bug 6590 - Linker-generated TOC16_DS relocations are misplaced
Summary: Linker-generated TOC16_DS relocations are misplaced
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-04 17:06 UTC by Yaakov Yaari
Modified: 2008-06-05 00:31 UTC (History)
3 users (show)

See Also:
Host:
Target: ppc64
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yaakov Yaari 2008-06-04 17:06:36 UTC
Following a recent change for handling --emit-relocs switch the Linker started
producing static relocations for code generated by the linker itself.

When generating R_PPC64_TOC16_DS relocations, which affects the low-order 16-bit
of the instruction, the linker places them instead on the instruction boundary.

In the example below the symbol-less relocations are the linker-generated ones
and are placed improperly on instruction boundaries (10000a9c, 10000aa0, ...),
while those with attached symbols are compiler-generated and are correctly
placed on the 2-low-order bytes of the respective instruction (10000ada, 10000adc)


0000000010000a9c  000000000000003f R_PPC64_TOC16_DS                            
   000000001001dab8
0000000010000aa0  000000000000003f R_PPC64_TOC16_DS                            
   000000001001dab0
0000000010000aac  000000000000003f R_PPC64_TOC16_DS                            
   000000001001da00
0000000010000ab4  000000000000003f R_PPC64_TOC16_DS                            
   000000001001da10
0000000010000ab8  000000000000003f R_PPC64_TOC16_DS                            
   000000001001da08
0000000010000ada  000000180000003f R_PPC64_TOC16_DS       000000001001d870 .got + 8
0000000010000adc  0000006d0000000a R_PPC64_REL24          0000000000000000
__libc_start_main@@GLIBC_2.3 + 0
0000000010000b0a  000000180000003f R_PPC64_TOC16_DS       000000001001d870 .got + 10
0000000010000b14  0000004e0000000a R_PPC64_REL24          0000000000000000
__gmon_start__ + 0
0000000010000b2e  000000180000003f R_PPC64_TOC16_DS       000000001001d870 .got + 18