Skip to contentSkip to conversation

sh: Fix FDPIC binary loader

PATCH In review Andrew Stubbs 3 participants 5 messages Mar 26, 2010 – Nov 19, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: Fix FDPIC binary loader

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work.

---

arch/sh/include/asm/elf.h +5 -3
index ac04255..b2fefb3 100644
@@ -211,15 +211,17 @@ extern void __kernel_vsyscall;
 
  #define VSYSCALL_AUX_ENT                                       \
         if (vdso_enabled)                                       \
-               NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
+               NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);        \
+       else                                                    \
+               NEW_AUX_ENT(AT_IGNORE, 0); /* Match AT_VECTOR_SIZE_ARCH.  */
  #else
-#define VSYSCALL_AUX_ENT
+#define VSYSCALL_AUX_ENT NEW_AUX_ENT(AT_IGNORE, 0);
  #endif /* CONFIG_VSYSCALL */
 
  #ifdef CONFIG_SH_FPU
  #define FPU_AUX_ENT    NEW_AUX_ENT(AT_FPUCW, FPSCR_INIT)
  #else
-#define FPU_AUX_ENT
+#define FPU_AUX_ENT    NEW_AUX_ENT(AT_IGNORE, 0);
  #endif
 
  extern int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;
#1 lore raw
Quoted 4 lines · Andrew Stubbs

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work.

This was whitespace damaged and didn't apply, so I did it by hand. Please double check your mailer settings for future patches, thanks.

#2 lore raw
In reply to Andrew Stubbs
Quoted 8 lines · Paul Mundt
Quoted 4 lines · Andrew Stubbs

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work.

This was whitespace damaged and didn't apply, so I did it by hand. Please double check your mailer settings for future patches, thanks.

Apologies for the mistake.

Thanks for taking the patch.

Andrew

#3 lore raw
In reply to Andrew Stubbs

Hi!

Quoted 3 lines · Paul Mundt
Quoted 2 lines · Andrew Stubbs

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work.

Andrew's patch became commit d5ab780305bb6d60a7b5a74f18cf84eb6ad153b1.

Quoted 1 line

This was whitespace damaged and didn't apply, so I did it by hand.

Unfortunately, in Paul's manual application, one part of the patch was lost, and that happened to be the functional part. I'm attaching a patch to address that. The patch is for 3.5.2, but likewise applies to the current master branch.

If you add that patch to, for example, »SH7269 Linux BSP«,
<https://oss.renesas.com/modules/download/index.php?cid=80&lid=231>, you can re-enable dynamic linking, and can remove the following note from its readme.txt:

| 1. The toolchain used can only be used with static builds. Do not use this with
| dynamically loaded shared libraries.

Grüße,
Thomas

From 23dc6096a678259662224de60470fababed35d2d Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <[email protected]>
Date: Fri, 16 Nov 2012 10:46:20 +0100
Subject: [PATCH] sh: Fix FDPIC binary loader

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work. This was meant to be included in commit d5ab780305bb6d60a7b5a74f18cf84eb6ad153b1.

---
 arch/sh/include/asm/elf.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sh/include/asm/elf.h +2 -2
index f38112b..978b7fd 100644
@@ -202,9 +202,9 @@ extern void __kernel_vsyscall;
 	if (vdso_enabled)					\
 		NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);	\
 	else							\
-		NEW_AUX_ENT(AT_IGNORE, 0);
+		NEW_AUX_ENT(AT_IGNORE, 0)
 #else
-#define VSYSCALL_AUX_ENT
+#define VSYSCALL_AUX_ENT	NEW_AUX_ENT(AT_IGNORE, 0)
 #endif /* CONFIG_VSYSCALL */
 
 #ifdef CONFIG_SH_FPU
Signature · 1 line
1.7.4.1
#4 lore raw
In reply to Andrew Stubbs
Quoted 5 lines · Thomas Schwinge
Quoted 3 lines · Paul Mundt
Quoted 2 lines · Andrew Stubbs

Ensure that the aux table is properly initialized, even when optional features are missing. Without this, the FDPIC loader did not work.

Quoted 9 lines

Andrew's patch became commit d5ab780305bb6d60a7b5a74f18cf84eb6ad153b1.

Quoted 1 line

This was whitespace damaged and didn't apply, so I did it by hand.

Unfortunately, in Paul's manual application, one part of the patch was lost, and that happened to be the functional part. I'm attaching a patch to address that. The patch is for 3.5.2, but likewise applies to the current master branch.

Good catch, thanks. I'll queue it up and make sure it finds its way back in to -stable, too.