lkml.org 
[lkml]   [2009]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 3/9] x86: add .broken section to the vDSO linker script
Date
This section should not contain anything unless the vDSO is
broken. It is intended to hold sections which are known not
to work correctly inside a vDSO.

If such a "broken" section is found at link-time, the linker
issues an error with a hint how to find out more.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
---
arch/x86/vdso/vdso-layout.lds.S | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
index af3fa61..cc66120 100644
--- a/arch/x86/vdso/vdso-layout.lds.S
+++ b/arch/x86/vdso/vdso-layout.lds.S
@@ -73,9 +73,33 @@ SECTIONS
.text : {
*(.text*)
} :text =0x90909090
+
+ /*
+ * Some sections require some additional work from the dynamic
+ * linker to work properly. However, there is no dynamic-link
+ * pass for the vDSO, so these sections will not work.
+ * Put them into a special section and raise a link-time error
+ * if they get used by accident.
+ */
+ .broken : {
+ }
}

/*
+ * This assert is triggered if the linker finds a section in one of its
+ * input files which is known not to work inside a vDSO.
+ *
+ * To see which is the offending sections, you may:
+ * a. use objdump -h on the object files which make up the vDSO, or
+ * b. add -Wl,-M to VDSO_LDFLAGS and examine the linker map.
+ *
+ * See individual comments in the definition of the .broken section
+ * above for more information on why any given section is considered
+ * "broken".
+ */
+ASSERT(!SIZEOF(.broken), "The vdso linker script found a section that is bad. See vdso-layout.lds.S for details.");
+
+/*
* Very old versions of ld do not recognize this name token; use the constant.
*/
#define PT_GNU_EH_FRAME 0x6474e550
--
1.6.0.2


\
 
 \ /
  Last update: 2009-06-16 14:59    [W:1.061 / U:0.092 seconds]
©2003-2014 Jasper Spaans. Advertise on this site