Bug 28006 - Linking 32-bit x86 binaries using gold drops the .note.gnu.property section
Summary: Linking 32-bit x86 binaries using gold drops the .note.gnu.property section
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-22 15:15 UTC by Nick Clifton
Modified: 2023-11-23 14:53 UTC (History)
3 users (show)

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


Attachments
Proposed patch (1.88 KB, patch)
2021-06-22 15:15 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clifton 2021-06-22 15:15:37 UTC
Created attachment 13511 [details]
Proposed patch

When linking 32-bit x86 binaries using the gold linker the .note.gnu.property section is not created.  The BFD linker on the other hand does create the section.

For example:

  % gcc -fcf-protection -m32 hello.c
  % readelf --notes a.out | grep SHSTK
     Properties: x86 feature: IBT, SHSTK
 
  % gcc -fcf-protection -m32 hello.c -fuse-ld=gold
  % readelf --notes a.out | grep SHSTK
  %

A suggested patch is attached.