Bug 2022470 - Cannot find symbol for section 11: .text.unlikely.
Summary: Cannot find symbol for section 11: .text.unlikely.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-11 17:57 UTC by Veronika Kabatova
Modified: 2022-12-13 15:50 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 15:50:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Veronika Kabatova 2021-11-11 17:57:16 UTC
Description of problem:

When compiling the kernel for ppc64le, the following error occurs:

00:02:53 Cannot find symbol for section 11: .text.unlikely.
00:02:53 kernel/kexec_file.o: failed
00:02:53 make[3]: *** [scripts/Makefile.build:277: kernel/kexec_file.o] Error 1
00:02:53 make[3]: *** Deleting file 'kernel/kexec_file.o'
00:02:53 make[3]: *** Waiting for unfinished jobs....

The error occurs during cross compilation in my case, however there is this reference to the same error which suggests it also happens with native compiles:

https://github.com/groeck/linux-build-test/commit/142cbefbc0d37962c9a6c7f28ee415ecd5fd1e98

According to the github commit above, the issue seems specific to the combination of gcc 11 with binutils 2.37, I was not able to verify this claim.


Version-Release number of selected component (if applicable):

gcc                                    x86_64  11.2.1-1.fc35
gcc-ppc64le-linux-gnu                  x86_64  11.2.1-1.fc35

binutils                               x86_64  2.37-10.fc35
binutils-ppc64le-linux-gnu             x86_64  2.37-2.fc35

How reproducible:

Always


Steps to Reproduce:
1. Grab a Fedora 35 host with the packages and kernel builddeps installed
2. git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --depth 1
3. cd linux
4. export ARCH=powerpc
5. export CROSS_COMPILE=powerpc64le-linux-gnu-
6. curl https://gitlab.com/redhat/red-hat-ci-tools/kernel/cki-internal-pipelines/cki-trusted-contributors/-/jobs/1760752896/artifacts/file/artifacts/kernel-mainline.kernel.org-ppc64le-e4e737bb5c170df6135a127739a9e6148ee3da82.config -o .config

The config is based on the Fedora kernel config, with kselftest options added to it.

7. make -j=24 INSTALL_MOD_STRIP=1 targz-pkg

Actual results:

The build fails with the error above

Expected results:

The build succeeds

Additional info:

From email exchange with Nick Clifton:

I *think* (but I am not sure) that the problem is happening because the
version of gcc you are using is newer, and it is putting code into the
.text.unlikely section.  In theory this is a good thing, as it allows
you to create linker scripts that puts code like this into cheaper/slower
memory and/or put code in sections like .text.likely or .text.hot all
in one place where there will be fewer cache misses.

Comment 1 Nick Clifton 2021-11-16 11:40:46 UTC
Hi Veronika,

> 00:02:53 Cannot find symbol for section 11: .text.unlikely.
> 00:02:53 kernel/kexec_file.o: failed

This message comes from the recordmcount tool, which is part of the kernel sources:

  linux/scripts/recordmcount.[ch]

It appears to be triggered when a compiler update causes code to be rearranged.
The problem has been reported before in various forums, but in particular I
found this reference:

  https://lore.kernel.org/lkml/20201204165742.3815221-2-arnd@kernel.org/

The point of which to me at least is that this is a kernel issue rather than
a compiler issue.  Ie there must be some weak symbols in kexec_file.o file
which need to be moved elsewhere.  Does this make sense ?

Cheers
  Nick

Comment 2 Veronika Kabatova 2021-11-24 12:25:58 UTC
(In reply to Nick Clifton from comment #1)
> Hi Veronika,
> 
> > 00:02:53 Cannot find symbol for section 11: .text.unlikely.
> > 00:02:53 kernel/kexec_file.o: failed
> 
> This message comes from the recordmcount tool, which is part of the kernel
> sources:
> 
>   linux/scripts/recordmcount.[ch]
> 
> It appears to be triggered when a compiler update causes code to be
> rearranged.
> The problem has been reported before in various forums, but in particular I
> found this reference:
> 
>   https://lore.kernel.org/lkml/20201204165742.3815221-2-arnd@kernel.org/
> 
> The point of which to me at least is that this is a kernel issue rather than
> a compiler issue.  Ie there must be some weak symbols in kexec_file.o file
> which need to be moved elsewhere.  Does this make sense ?
> 

Thanks for the analysis! I'll reach out to the devels to see if this is
something that can be fixed or what the cause is.

> Cheers
>   Nick

Comment 3 Ben Cotton 2022-11-29 17:17:53 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Ben Cotton 2022-12-13 15:50:41 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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