Skip to content

.init.data has both ordered and unordered sections #1507

Description

@nathanchance

@roxell reported on IRC:

$ make -skj"$(nproc)" ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- distclean defconfig

$ scripts/config -e FTRACE  -e STACK_TRACER

$ make -skj"$(nproc)" ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- olddefconfig vmlinux
aarch64-linux-gnu-ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.meminit.data' in mm/sparse.o] sections
aarch64-linux-gnu-ld: final link failed: bad value
...

$ aarch64-linux-gnu-ld --version
GNU ld (GNU Binutils for Debian) 2.35.2
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

$ clang --version
Debian clang version 13.0.1-++20211029101439+08e3a5ccd952-1~exp1~20211029222017.20
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

I reproduced it via the TuxMake arm64 clang-13 image (docker.io/tuxmake/arm64_clang-13) and it is reproducible on the clang-nightly image as well. A locally produced clang-13 image based on Ubuntu 21.10 did not reproduce the issue:

$ aarch64-linux-gnu-ld --version
GNU ld (GNU Binutils for Ubuntu) 2.37
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

$ clang --version
Ubuntu clang version 13.0.0-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

The issue is not present with LLVM=1.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions