bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/25154] New: Orphan section ".got" is placed differently


From: i at maskray dot me
Subject: [Bug ld/25154] New: Orphan section ".got" is placed differently
Date: Sat, 02 Nov 2019 06:26:18 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25154

            Bug ID: 25154
           Summary: Orphan section ".got" is placed differently
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

cat > a.x <<e
  SECTIONS { .foo : { *(.foo) } }
e
cat > a.s <<e
  .section .foo,"w"; .byte 0
  .section .got,"w"; .byte 0
e
cat > b.s <<e
  .section .foo,"w"; .byte 0
  .section .aaa,"w"; .byte 0
e

as a.s -o a.o && ld.bfd a.o -T a.x -o a && readelf -S a

The orphan section .got is placed before .foo

  [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00     
0   0  0
  [ 1] .got              PROGBITS        0000000000000000 001000 000001 00  WA 
0   0  8
  [ 2] .foo              PROGBITS        0000000000000001 001001 000001 00   W 
0   0  1
  ...

as b.s -o b.o && ld.bfd b.o -T a.x -o b && readelf -S b

The name ".got" is special. If the section is named differently, e.g. .aaa,
.got2, it will be placed after .foo

  [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00     
0   0  0
  [ 1] .foo              PROGBITS        0000000000000000 000040 000001 00   W 
0   0  1
  [ 2] .aaa              PROGBITS        0000000000000000 000041 000001 00   W 
0   0  1
  ...

-- 
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]