1
From a3582e37351596119e947b0606021aedb19b6f61 Mon Sep 17 00:00:00 2001
2
From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org>
3
Date: Sun, 17 Jan 2010 12:09:38 +0100
4
Subject: [PATCH] Fix missing symbols in .rel/.rela.plt sections
6
Content-Type: text/plain; charset=UTF-8
7
Content-Transfer-Encoding: 8bit
9
Fix .rel.plt sections in the output to not only include .rel.plt
10
sections from the input but also the .rel.iplt sections and to define
11
the hidden symbols __rel_iplt_start and __rel_iplt_end around
12
.rel.iplt as otherwise we get undefined references to these when
13
linking statically to a multilib libc.a. This fixes the static build
16
Apply similar logic to rela.plt/.iplt and __rela_iplt/_plt_start/_end to
17
fix the static build under amd64.
19
Signed-off-by: Lo�c Minier <lool@dooz.org>
21
i386.ld | 16 ++++++++++++++--
22
x86_64.ld | 16 ++++++++++++++--
23
2 files changed, 28 insertions(+), 4 deletions(-)
25
diff --git a/i386.ld b/i386.ld
26
index f2dafec..f8df7bf 100644
29
@@ -39,8 +39,20 @@ SECTIONS
30
.rela.fini : { *(.rela.fini) }
31
.rel.bss : { *(.rel.bss) }
32
.rela.bss : { *(.rela.bss) }
33
- .rel.plt : { *(.rel.plt) }
34
- .rela.plt : { *(.rela.plt) }
38
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
40
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
45
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
47
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
49
.init : { *(.init) } =0x47ff041f
52
diff --git a/x86_64.ld b/x86_64.ld
53
index 24ea77d..46d8d4d 100644
56
@@ -35,8 +35,20 @@ SECTIONS
57
.rela.got : { *(.rela.got) }
58
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
59
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
60
- .rel.plt : { *(.rel.plt) }
61
- .rela.plt : { *(.rela.plt) }
65
+ PROVIDE_HIDDEN (__rel_iplt_start = .);
67
+ PROVIDE_HIDDEN (__rel_iplt_end = .);
72
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
74
+ PROVIDE_HIDDEN (__rela_iplt_end = .);