Skip to content

Commit aa5fb4d

Browse files
Roland McGrathtorvalds
authored andcommitted
uml: fix CONFIG_STATIC_LINK=y build failure with newer glibc
With glibc 2.11 or later that was built with --enable-multi-arch, the UML link fails with undefined references to __rel_iplt_start and similar symbols. In recent binutils, the default linker script defines these symbols (see ld --verbose). Fix the UML linker scripts to match the new defaults for these sections. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d911202 commit aa5fb4d

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎arch/um/kernel/dyn.lds.S‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ SECTIONS
5050
.rela.got : { *(.rela.got) }
5151
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
5252
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
53-
.rel.plt : { *(.rel.plt) }
54-
.rela.plt : { *(.rela.plt) }
53+
.rel.plt : {
54+
*(.rel.plt)
55+
PROVIDE_HIDDEN(__rel_iplt_start = .);
56+
*(.rel.iplt)
57+
PROVIDE_HIDDEN(__rel_iplt_end = .);
58+
}
59+
.rela.plt : {
60+
*(.rela.plt)
61+
PROVIDE_HIDDEN(__rela_iplt_start = .);
62+
*(.rela.iplt)
63+
PROVIDE_HIDDEN(__rela_iplt_end = .);
64+
}
5565
.init : {
5666
KEEP (*(.init))
5767
} =0x90909090

‎arch/um/kernel/uml.lds.S‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ SECTIONS
4343
__syscall_stub_end = .;
4444
}
4545

46+
/*
47+
* These are needed even in a static link, even if they wind up being empty.
48+
* Newer glibc needs these __rel{,a}_iplt_{start,end} symbols.
49+
*/
50+
.rel.plt : {
51+
*(.rel.plt)
52+
PROVIDE_HIDDEN(__rel_iplt_start = .);
53+
*(.rel.iplt)
54+
PROVIDE_HIDDEN(__rel_iplt_end = .);
55+
}
56+
.rela.plt : {
57+
*(.rela.plt)
58+
PROVIDE_HIDDEN(__rela_iplt_start = .);
59+
*(.rela.iplt)
60+
PROVIDE_HIDDEN(__rela_iplt_end = .);
61+
}
62+
4663
#include "asm/common.lds.S"
4764

4865
init.data : { INIT_DATA }

0 commit comments

Comments
 (0)