Skip to contentSkip to conversation

alpha: hack objstrip.c to make it compile.

RFC In review Matt Turner 2 participants 4 messages Mar 30, 2010 Alpha port

lore
Share & tools
lore

Matt Turner

author maintainer
#0 lore raw

RFC 1/1 alpha: hack objstrip.c to make it compile.

I don't think this is the appropriate fix. What should I do to fix this?

---
 arch/alpha/boot/tools/objstrip.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/alpha/boot/tools/objstrip.c +3 -0
index 367d53d..54fa1ef 100644
@@ -27,6 +27,9 @@
 #include <linux/param.h>
 #ifdef __ELF__
 # include <linux/elf.h>
+# define elfhdr	elf64_hdr
+# define elf_phdr	elf64_phdr
+# define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
 #endif
 
 /* bootfile size must be multiple of BLOCK_SIZE: */
Signature · 1 line
1.6.4.4
#1 lore raw
Quoted 10 lines · Matt Turner

I don't think this is the appropriate fix. What should I do to fix this?

---
 arch/alpha/boot/tools/objstrip.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/alpha/boot/tools/objstrip.c +0 -0
index 367d53d..54fa1ef 100644

arch/alpha/boot/tools/objstrip.c line 34

Quoted 8 lines
arch/alpha/boot/tools/objstrip.c +3 -0
@@ -27,6 +27,9 @@
 #include <linux/param.h>
 #ifdef __ELF__
 # include <linux/elf.h>
+# define elfhdr	elf64_hdr
+# define elf_phdr	elf64_phdr
+# define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
 #endif
 

Hum. Is it so bad to just #define __KERNEL__ here before that one include? Similar games are played in tools/perf/, and with a suitible comment I think that should be all right.

r~

author maintainer
#2 lore raw
Quoted 25 lines · Richard Henderson
Quoted 10 lines · Matt Turner

I don't think this is the appropriate fix. What should I do to fix this?
---
 arch/alpha/boot/tools/objstrip.c |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
arch/alpha/boot/tools/objstrip.c +0 -0
index 367d53d..54fa1ef 100644

arch/alpha/boot/tools/objstrip.c line 34

Quoted 8 lines
arch/alpha/boot/tools/objstrip.c +3 -0
@@ -27,6 +27,9 @@
  #include <linux/param.h>
  #ifdef __ELF__
  # include <linux/elf.h>
+# define elfhdr      elf64_hdr
+# define elf_phdr    elf64_phdr
+# define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
  #endif
 

Hum.  Is it so bad to just #define __KERNEL__ here before that one include?  Similar games are played in tools/perf/, and with a suitible comment I think that should be all right.

Quoted 1 line

r~

The problem is that, at least with my distribution, probably others too, the headers installed into /usr/include/linux/ are stripped of anything inside #ifdef __KERNEL__.

Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 3 lines · Matt Turner

The problem is that, at least with my distribution, probably others too, the headers installed into /usr/include/linux/ are stripped of anything inside #ifdef __KERNEL__.

I thought this was built with kernel header files? It used to be.

If it's built with system header files now, you might as well convert the thing to use <elf.h> instead. Which shouldn't be too much different from what you've done already. Although I wouldn't bother with the #defines... just propagate the name changes into the source proper.

r~