[PATCH,V3 0/9] Fix relocatable SFrame links

Indu Bhagat indu.bhagat@oracle.com
Fri Jun 13 07:32:16 GMT 2025


Hi,

This patch series fixes two SFrame issues related to relocatable links.
  PR/32666  Incorrect .rela.sframe when using ld -r
  PR libsframe/32589 - function start address is zero in SFrame section dump

Review comments from V2 have been addressed.

V1 posting: https://sourceware.org/pipermail/binutils/2025-May/141430.html
V2 posting: https://sourceware.org/pipermail/binutils/2025-June/141569.html

This series is based on the previously suggested "Scheme#B" approach, an RFC of
which was previously deemed the right way to fix these issues.  In this
approach, we add a new flag in the SFrame version 2 specification,
SFRAME_F_FDE_FUNC_START_ADDR_PCREL. With the fixes, gas and ld always emit this
flag by default.

[RFC,SCHEME_B 0/7] Fix relocatable links with SFrame section
https://inbox.sourceware.org/binutils/20250407002559.6593-1-indu.bhagat@oracle.com/

Thanks

Indu Bhagat (8):
  include: libsframe: add APIs for SFrame header flags
  libsframe: refactor code for dumping section flags
  include: libsframe: add APIs for offsetof FDE func start addr field
  include: sframe: doc: define new flag
    SFRAME_F_FDE_FUNC_START_ADDR_PCREL
  objdump, readelf: sframe: apply relocations before textual dump
  bfd: gas: ld: libsframe: adopt new encoding for FDE func start addr
    field
  ld: bfd: sframe: fix incorrect r_offset in RELA entries
  NEWS: sframe: mention new semantics for SFrame FDE function start addr

Jens Remus (1):
  ld: bfd: sframe: Update section size also for relocatable links

 bfd/elf-bfd.h                                 |  11 ++
 bfd/elf-sframe.c                              | 124 +++++++++++++++-
 bfd/elf.c                                     |   3 +
 bfd/elfxx-x86.c                               |   2 +-
 binutils/NEWS                                 |  10 ++
 binutils/dwarf.c                              |  35 +++++
 binutils/dwarf.h                              |   1 +
 binutils/objdump.c                            |  59 +++-----
 binutils/readelf.c                            |  50 ++-----
 gas/NEWS                                      |   5 +
 gas/gen-sframe.c                              |   4 +
 .../gas/cfi-sframe/cfi-sframe-aarch64-1.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-2.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-3.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-aarch64-4.d     |   2 +-
 .../cfi-sframe-aarch64-pac-ab-key-1.d         |  10 +-
 .../gas/cfi-sframe/cfi-sframe-common-1.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-10.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-11.d     |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-2.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-3.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-4.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-5.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-6.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-7.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-8.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-common-9.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-1.d      |   2 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-2.d      |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-1.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-2.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-3.d    |   2 +-
 .../cfi-sframe/cfi-sframe-x86_64-empty-4.d    |   2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-1.d |   2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-2.d |   2 +-
 gas/testsuite/gas/cfi-sframe/common-empty-3.d |   2 +-
 .../gas/scfi/x86_64/scfi-cfi-sections-1.d     |   2 +-
 .../gas/scfi/x86_64/scfi-dyn-stack-1.d        |   2 +-
 include/sframe-api.h                          |  32 ++++
 include/sframe.h                              |  10 +-
 ld/NEWS                                       |   5 +
 ld/testsuite/ld-aarch64/sframe-simple-1.d     |   3 +-
 ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d     |   3 +-
 ld/testsuite/ld-x86-64/sframe-plt-1.d         |   3 +-
 ld/testsuite/ld-x86-64/sframe-pltgot-1.d      |   3 +-
 ld/testsuite/ld-x86-64/sframe-pltgot-2.d      |   3 +-
 ld/testsuite/ld-x86-64/sframe-reloc-1.d       |  35 +++++
 ld/testsuite/ld-x86-64/sframe-simple-1.d      |   3 +-
 ld/testsuite/ld-x86-64/x86-64.exp             |   1 +
 libsframe/doc/sframe-spec.texi                |  29 +++-
 libsframe/libsframe.ver                       |   7 +
 libsframe/sframe-dump.c                       |  73 +++++----
 libsframe/sframe.c                            | 138 +++++++++++++++---
 .../testsuite/libsframe.find/findfre-1.c      |  13 +-
 .../testsuite/libsframe.find/findfunc-1.c     |  18 ++-
 .../testsuite/libsframe.find/plt-findfre-1.c  |   8 +-
 56 files changed, 565 insertions(+), 188 deletions(-)
 create mode 100644 ld/testsuite/ld-x86-64/sframe-reloc-1.d

-- 
2.43.0



More information about the Binutils mailing list