From ac0fe6dabaf05bf434e9c57d4f9b61d73f660e3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org>
Date: Sun, 17 Jan 2010 12:09:38 +0100
Subject: [PATCH] Fix missing symbols in .rela.plt sections
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix .rela.plt sections in the output to not only include .rela.plt
sections from the input but also the .rela.iplt sections and to define
the hidden symbols __rela_iplt_start and __rela_iplt_end around
.rela.iplt as otherwise we get undefined references to these when
linking statically to a multilib libc.a.
Signed-off-by: Loïc Minier <lool@dooz.org>
---
i386.ld | 8 +++++++-
x86_64.ld | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
@@ -40,7 +40,13 @@ SECTIONS
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
.init : { *(.init) } =0x47ff041f
.text :
{
@@ -36,7 +36,13 @@ SECTIONS
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
.rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
+ .rela.plt :
+ {
+ *(.rela.plt)
+ PROVIDE_HIDDEN (__rela_iplt_start = .);
+ *(.rela.iplt)
+ PROVIDE_HIDDEN (__rela_iplt_end = .);
+ }
.init :
{
KEEP (*(.init))
--
1.6.5