public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/99836] New: aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs
@ 2021-03-30 18:20 i at maskray dot me
  2021-03-31 10:21 ` [Bug target/99836] " rearnsha at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: i at maskray dot me @ 2021-03-30 18:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99836

            Bug ID: 99836
           Summary: aarch64: -fpatchable-function-entry=N[,0] should place
                    .cfi_startproc before NOPs
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i at maskray dot me
  Target Milestone: ---

Extracted from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424#c8

% echo 'int main() {}' > a.c
% clang --target=aarch64 -fpatchable-function-entry=2
-mbranch-protection=standard -S a.c -o -
...
main:                                   // @main
.Lfunc_begin0:
        .cfi_startproc
// %bb.0:                               // %entry
        hint    #34
.Lpatch0:
        nop
        nop

%
/tmp/glibc-many/install/compilers/aarch64-linux-gnu/bin/aarch64-glibc-linux-gnu-g++
-fpatchable-function-entry=2 -mbranch-protection=standard -S a.c -o -
        .arch armv8-a
        .file   "a.c"
        .text
        .align  2
        .global main
        .type   main, %function
main:
        hint    34 // bti c
        .section        __patchable_function_entries,"aw",@progbits
        .align  3
        .8byte  .LPFE1
        .text
.LPFE1:
        nop
        nop
.LFB0:
        .cfi_startproc


For -fpatchable-function-entry=N[,0], placing .cfi_startproc before NOPs makes
more sense and can make unwinding work in that region.

For N[,M] where M>0, that is a very narrow use case by the Linux kernel. I
prefer not to place .cfi_startproc above the function label.

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

* [Bug target/99836] aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs
  2021-03-30 18:20 [Bug target/99836] New: aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs i at maskray dot me
@ 2021-03-31 10:21 ` rearnsha at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2021-03-31 10:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99836

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Dup

*** This bug has been marked as a duplicate of bug 98776 ***

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

end of thread, other threads:[~2021-03-31 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 18:20 [Bug target/99836] New: aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs i at maskray dot me
2021-03-31 10:21 ` [Bug target/99836] " rearnsha at gcc dot gnu.org

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).