bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/15370] New: linker script does not group sections correctly wh


From: anton at samba dot org
Subject: [Bug gold/15370] New: linker script does not group sections correctly when building ppc64 Linux kernel
Date: Mon, 15 Apr 2013 07:59:31 +0000

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

             Bug #: 15370
           Summary: linker script does not group sections correctly when
                    building ppc64 Linux kernel
           Product: binutils
           Version: 2.24 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified


Created attachment 6987
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6987
Testcase

We see a failure when building the ppc64 Linux kernel. We require __ftr_alt
sections to be placed directly after the object's text section and have the
following in our linker script:

    .text           :
    {
        *(.text __ftr_alt_*)
    }

The __ftr_alt sections contain instructions that we relocate and copy over the
kernel as a part of our runtime patching code.

On the bfd linker this works, but on gold all the __ftr_alt sections are placed
at the end of the text section. When this happens conditional branches cannot
be relocated and the kernel panics.

The attached testcase shows this behaviour, ld.bfd behaves as expected by
ld.gold fails:


# ./testcase

test:     file format elf64-powerpc


Disassembly of section .text:

0000000000000000 <_start>:
   0:    60 21 00 01     ori     r1,r1,1
   4:    60 42 00 02     ori     r2,r2,2
   8:    60 63 00 03     ori     r3,r3,3
   c:    60 84 00 04     ori     r4,r4,4
  10:    60 a5 00 05     ori     r5,r5,5
  14:    60 c6 00 06     ori     r6,r6,6

test:     file format elf64-powerpc


Disassembly of section .text:

0000000000000024 <_start>:
  24:    60 21 00 01     ori     r1,r1,1
  28:    60 42 00 02     ori     r2,r2,2
  2c:    60 84 00 04     ori     r4,r4,4
  30:    60 a5 00 05     ori     r5,r5,5
  34:    60 63 00 03     ori     r3,r3,3
  38:    60 c6 00 06     ori     r6,r6,6

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]