Skip to content

Commit a725701

Browse files
AaronDotopsiff
authored andcommitted
vmlinux: Avoid weak reference to notes section
commit 377d909 upstream. Weak references are references that are permitted to remain unsatisfied in the final link. This means they cannot be implemented using place relative relocations, resulting in GOT entries when using position independent code generation. The notes section should always exist, so the weak annotations can be omitted. Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Binbin Zhou <[email protected]>
1 parent f58bb0d commit a725701

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kernel/ksysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ KERNEL_ATTR_RW(rcu_normal);
226226
/*
227227
* Make /sys/kernel/notes give the raw contents of our kernel .notes section.
228228
*/
229-
extern const void __start_notes __weak;
230-
extern const void __stop_notes __weak;
229+
extern const void __start_notes;
230+
extern const void __stop_notes;
231231
#define notes_size (&__stop_notes - &__start_notes)
232232

233233
static ssize_t notes_read(struct file *filp, struct kobject *kobj,

lib/buildid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ unsigned char vmlinux_build_id[BUILD_ID_SIZE_MAX] __ro_after_init;
213213
*/
214214
void __init init_vmlinux_build_id(void)
215215
{
216-
extern const void __start_notes __weak;
217-
extern const void __stop_notes __weak;
216+
extern const void __start_notes;
217+
extern const void __stop_notes;
218218
unsigned int size = &__stop_notes - &__start_notes;
219219

220220
build_id_parse_buf(&__start_notes, vmlinux_build_id, size);

0 commit comments

Comments
 (0)