bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/32341] New: ld does not keep SHF_ALLOC section indices contiguou


From: amerey at redhat dot com
Subject: [Bug ld/32341] New: ld does not keep SHF_ALLOC section indices contiguous
Date: Tue, 05 Nov 2024 22:39:39 +0000

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

            Bug ID: 32341
           Summary: ld does not keep SHF_ALLOC section indices contiguous
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: amerey at redhat dot com
  Target Milestone: ---

Created attachment 15780
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15780&action=edit
sections and segments info for strip with contiguous SHF_ALLOC

Since commit 7ecf0250f7f086, ld appears more likely to not keep all SHF_ALLOC
sections indices in a contiguous group. This results in an additional
(unnecessary) PT_LOAD segment.

For example, using ld built from commit 7ecf0250f7f086, the elfutils strip
executable contains the following sections:

[24] .bss                 NOBITS       0000000000453660 00052660 000002c8  0 WA
    0   0 32  
[25] .comment             PROGBITS     0000000000000000 00052948 0000002e  1 MS
    0   0  1  
[26] .annobin.notes       STRTAB       0000000000000000 00052976 0000014f  1 MS
    0   0  1  
[27] .gnu.build.attributes NOTE         0000000000455928 00052ac8 00000144  0  
     0   0  4  
[28] .note.ABI-tag        NOTE         0000000000455928 00052928 00000020  0 A 
    0   0  4

Sections 24 and 28 have SHF_ALLOC while sections 25-27 do not. The strip
executable also contains 5 PT_LOAD segments (see attachment).

Using ld build from the previous commit (4339a3ffc39), this does not occur.
Section .note.ABI-tag appears at index 3 (right after .note.gnu.build-id at
index 2) instead of 28, which keeps all SHF_ALLOC sections indices contiguous.
There are also 4 PT_LOADs instead of 5 (see attachment).

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