RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2092438 - wrong function entry listed in debuginfo with -fpatchable-function-entry
Summary: wrong function entry listed in debuginfo with -fpatchable-function-entry
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gcc
Version: 9.0
Hardware: aarch64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Marek Polacek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 2087087
TreeView+ depends on / blocked
 
Reported: 2022-06-01 14:29 UTC by William Cohen
Modified: 2023-07-18 14:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-02 14:41:02 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Tarball showing the issue with -fpatchable-function-entry on aarch64 (17.13 KB, application/gzip)
2022-06-01 14:29 UTC, William Cohen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-123915 0 None None None 2022-06-01 14:46:26 UTC

Description William Cohen 2022-06-01 14:29:15 UTC
Created attachment 1885810 [details]
Tarball showing the issue with -fpatchable-function-entry on aarch64

Description of problem:
When the  -fpatchable-function-entry is used the debuginfo indicates that the function starts after the nop instructions inserted at the beginning of the function.  This issue looks very similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103525


Version-Release number of selected component (if applicable):
gcc-11.2.1-9.4.el9.aarch64

How reproducible: every time


Steps to Reproduce:
1. Download the gcc_patchable.tar.gz in this bug
2. tar xvfz ./gcc_patchable.tar.gz 
3. cd gcc_patchable
4. gcc -fpatchable-function-entry=8 -g -O2 -save-temps u32_test.c -o u32_test
5. llvm-dwarfdump  --name="main" u32_test
6. nm u32_test |grep main


Actual results:
The nm states that the function starts at 0000000000400580, but the DW_AT_low_pc states it starts later at 0x00000000004005a0




Expected results:
The DW_AT_low_pc and start of the function reported by nm should match.


Additional info:

This issue was observed  because the RHEL kernels are compiled with 
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y.

One of the comments, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103525#c2 , mentions that a similar issue was addressed on x86_64.

Comment 1 Marek Polacek 2022-06-02 14:41:02 UTC
I've updated PR103525 but it's been in NEW for 6 months, so I think this is not going to be fixed anytime soon.  So it seems appropriate to track this upstream only.


Note You need to log in before you can comment on or make changes to this bug.