public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 00/15] sframe: Enhancements to SFrame info generation
@ 2024-04-12 14:47 Jens Remus
  2024-04-12 14:47 ` [PATCH v3 01/15] x86: Remove unused SFrame CFI RA register variable Jens Remus
                   ` (14 more replies)
  0 siblings, 15 replies; 44+ messages in thread
From: Jens Remus @ 2024-04-12 14:47 UTC (permalink / raw)
  To: binutils, Indu Bhagat; +Cc: Jens Remus, Andreas Krebbel

As suggested by Indu I have split my RFC V2 patch series to add initial
support to generate SFrame information on s390x into:

1. This series consisting of all the generic preparatory cleanups,
   enhancements, and fixes to the generation of SFrame information
   in the assembler.

2. A separate RFC series on top with the actual "s390: Initial support
   to generate SFrame info from CFI directives in assembler", which I
   am going to send soon.

Since the original patch series was at V2 I am sending both as V3.


Patches 1 and 2 are minor cleanups/enhancements to the existing SFrame
support on AArch64 and x86 AMD64.

Patch 3 enables readelf/objdump to dump the SFrame fixed offsets from
CFA to the frame pointer (FP) and return address (RA).

Patch 4 (new in v3) changes readelf/objdump to display 'f' in the SFrame
RA tracking column, if the architecture is using a fixed RA offset.
Additionally it corrects the logic to display 'u' in the SFrame
FP tracking column.

Patch 5 enhances an SFrame warning message to print the human readable
DWARF call frame instruction name.

Patches 6 and 7 resolve issues that cause the assembler to either
generate bad SFrame FDE or to silently skip it. Both issues would be
triggered by s390-specific SFrame error test cases introduced by the
separate patch series.

Patch 8 refactors SFrame CFI opcode DW_CFA_register processing into a
separate function. This harmonizes the CFI opcode processing.

Patch 9 adds verbose assembler warning messages when generation of
SFrame FDE is skipped.

Patch 10 (new in v3) resolves an issue that causes the assembler to
generate bad SFrame FDE in case the FP without RA was saved on the
stack, which the SFrame format cannot represent. I will send two
alternative solution proposals as RFC.

Patch 11 (new in v3) skips SFrame FDE for .cfi_window_save on all
architectures except AArch64, which multiplexed it with
.cfi_negate_ra_state.

Patches 12 and 13 (both new in v3) resolve issues where generation of
SFrame FDE was unnecessarily skipped.

Path 14 (new in v3) adds tests for the SFrame RA tracking predicate to
places where it was missing to align the logic.

Patch 14 (new in v3) is a minor enhancement to add checks that the
architecture-dependent RA tracking is correctly configured.


Changes v2 -> v3:
- Additional patches as noted in cover letter and patch notes.
- Reword further SFrame macro, variable, and function descriptions
  to align with those previously touched.
- Align description of definition in source with declaration in header.
- Updated gas synthesized CFI test cases for x86 AMD64 to test for
  architecture-specific fixed RA offset instead of using a pattern.
- Updated ld SFrame test cases for x86 AMD64 to test for architecture-
  specific fixed RA offset.
- Updated SFrame warning message texts as suggested by Indu, except for
  the .cfi_def_cfa[_register] ones.
- Do not test sframe_ra_tracking_p when determining the SFrame register
  name in sframe_register_name. The RA register name does not depend on
  whether RA tracking is used or not.
- Corrected formatting of ChangeLog in commit message.

Changes v1 -> v2:
- Resolved a regression reported by Linaro-TCWG-CI on AArch64 in one of
  the generic ld SFrame test cases. The test case contained a
  .cfi_def_cfa directive, specifying a CFA base register number that is
  not necessarily a SFrame SP/FP register number on all architectures.
  This caused the changes from patch 6 to skip SFrame FDE generation on
  AArch64 (and s390x aswell) with a warning, causing the test case to
  fail.

Thanks and regards,
Jens

Jens Remus (15):
  x86: Remove unused SFrame CFI RA register variable
  gas: Enhance arch-specific SFrame configuration descriptions
  readelf/objdump: Dump SFrame CFA fixed FP and RA offsets
  readelf/objdump: Display SFrame fixed RA offset as 'f' in dump
  gas: Print DWARF call frame insn name in SFrame warning message
  gas: Skip SFrame FDE if CFI specifies non-FP/SP base register
  gas: Warn if SFrame FDE is skipped due to non-default return column
  gas: Refactor SFrame CFI opcode DW_CFA_register processing
  gas: User readable warnings if SFrame FDE is not generated
  gas: Skip SFrame FDE if FP without RA on stack
  gas: Skip SFrame FDE if .cfi_window_save
  gas: Don't skip SFrame FDE if .cfi_register specifies RA w/o tracking
  gas: Don't skip SFrame FDE if .cfi_register specifies SP register
  gas: Test predicate whether SFrame RA tracking is used
  gas: Validate SFrame RA tracking and fixed RA offset

 gas/config/tc-aarch64.c                       |   6 +-
 gas/config/tc-aarch64.h                       |  12 +-
 gas/config/tc-i386.c                          |   6 +-
 gas/config/tc-i386.h                          |  10 +-
 gas/gen-sframe.c                              | 244 +++++++++++++++---
 gas/gen-sframe.h                              |   2 +
 .../gas/cfi-sframe/cfi-sframe-common-1.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      |   6 +-
 .../gas/cfi-sframe/cfi-sframe-common-5.d      |   6 +-
 .../gas/cfi-sframe/cfi-sframe-common-6.d      |   6 +-
 .../gas/cfi-sframe/cfi-sframe-common-7.d      |   6 +-
 .../gas/cfi-sframe/cfi-sframe-common-8.d      |   4 +-
 .../gas/cfi-sframe/cfi-sframe-x86_64-1.d      |   9 +-
 gas/testsuite/gas/cfi-sframe/common-empty-1.d |   4 +-
 gas/testsuite/gas/cfi-sframe/common-empty-2.d |   4 +-
 gas/testsuite/gas/cfi-sframe/common-empty-3.d |   3 +
 .../gas/scfi/x86_64/scfi-cfi-sections-1.d     |  11 +-
 .../gas/scfi/x86_64/scfi-dyn-stack-1.d        |  11 +-
 ld/testsuite/ld-sframe/discard.s              |   1 -
 ld/testsuite/ld-x86-64/sframe-plt-1.d         |   9 +-
 ld/testsuite/ld-x86-64/sframe-simple-1.d      |  17 +-
 libsframe/sframe-dump.c                       |  18 +-
 24 files changed, 310 insertions(+), 91 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2024-05-16 20:45 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12 14:47 [PATCH v3 00/15] sframe: Enhancements to SFrame info generation Jens Remus
2024-04-12 14:47 ` [PATCH v3 01/15] x86: Remove unused SFrame CFI RA register variable Jens Remus
2024-04-12 14:47 ` [PATCH v3 02/15] gas: Enhance arch-specific SFrame configuration descriptions Jens Remus
2024-04-18  7:39   ` Indu Bhagat
2024-05-03 12:30     ` Jens Remus
2024-04-12 14:47 ` [PATCH v3 03/15] readelf/objdump: Dump SFrame CFA fixed FP and RA offsets Jens Remus
2024-04-18  7:39   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 04/15] readelf/objdump: Display SFrame fixed RA offset as 'f' in dump Jens Remus
2024-04-18  7:40   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 05/15] gas: Print DWARF call frame insn name in SFrame warning message Jens Remus
2024-04-18  7:40   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 06/15] gas: Skip SFrame FDE if CFI specifies non-FP/SP base register Jens Remus
2024-04-18  7:40   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 07/15] gas: Warn if SFrame FDE is skipped due to non-default return column Jens Remus
2024-04-18  7:40   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 08/15] gas: Refactor SFrame CFI opcode DW_CFA_register processing Jens Remus
2024-04-18  7:40   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 09/15] gas: User readable warnings if SFrame FDE is not generated Jens Remus
2024-04-18 20:33   ` Indu Bhagat
2024-05-03 12:30     ` Jens Remus
2024-05-03 23:41       ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 10/15] gas: Skip SFrame FDE if FP without RA on stack Jens Remus
2024-04-16 13:14   ` Jens Remus
2024-04-17 23:56     ` Indu Bhagat
2024-04-18 10:27       ` Jens Remus
2024-04-18 20:35   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 11/15] gas: Skip SFrame FDE if .cfi_window_save Jens Remus
2024-04-18 20:36   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 12/15] gas: Don't skip SFrame FDE if .cfi_register specifies RA w/o tracking Jens Remus
2024-04-18 20:36   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 13/15] gas: Don't skip SFrame FDE if .cfi_register specifies SP register Jens Remus
2024-04-18 20:37   ` Indu Bhagat
2024-04-19 13:13     ` Jens Remus
2024-04-23  8:15       ` Indu Bhagat
2024-04-25 22:22         ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 14/15] gas: Test predicate whether SFrame RA tracking is used Jens Remus
2024-04-18 20:37   ` Indu Bhagat
2024-04-12 14:47 ` [PATCH v3 15/15] gas: Validate SFrame RA tracking and fixed RA offset Jens Remus
2024-04-18 20:38   ` Indu Bhagat
2024-05-03 16:40     ` Jens Remus
2024-05-04  0:22       ` Indu Bhagat
2024-05-06 11:41         ` Jens Remus
2024-05-06 14:39           ` Jens Remus
2024-05-16 20:45             ` Indu Bhagat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).