[PATCH 05/13] Hide some of "struct elf_prstatus" behind #ifdef __KERNEL__

2015-09-09 Thread Palmer Dabbelt
This one scares me: while I can't find any system calls that directly
take this as an argument, a comment in 

  "
   Generic ptrace interface that exports the architecture specific
   regsets using the corresponding NT_* types (which are also used in
   the core dump).  Please note that the NT_PRSTATUS note type in a
   core dump contains a full 'struct elf_prstatus'. But the
   user_regset for NT_PRSTATUS contains just the elf_gregset_t that is
   the pr_reg field of 'struct elf_prstatus'. For all the other
   user_regset flavors, the user_regset layout and the ELF core dump
   note payload are exactly the same layout.
  "

seems to indicate that it's possible to see this sometimes.  Since
this would only be visible to userspace in a somewhat convoluted
manner, I'm going to try and keep it as it was.

Signed-off-by: Palmer Dabbelt 
Reviewed-by: Andrew Waterman 
Reviewed-by: Albert Ou 
---
 include/uapi/linux/elfcore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/elfcore.h b/include/uapi/linux/elfcore.h
index 569737cfb557..f9320b588937 100644
--- a/include/uapi/linux/elfcore.h
+++ b/include/uapi/linux/elfcore.h
@@ -60,7 +60,7 @@ struct elf_prstatus
longpr_instr;   /* Current instruction */
 #endif
elf_gregset_t pr_reg;   /* GP registers */
-#ifdef CONFIG_BINFMT_ELF_FDPIC
+#if defined(__KERNEL__) && defined(CONFIG_BINFMT_ELF_FDPIC)
/* When using FDPIC, the loadmap addresses need to be communicated
 * to GDB in order for GDB to do the necessary relocations.  The
 * fields (below) used to communicate this information are placed
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/13] Hide some of "struct elf_prstatus" behind #ifdef __KERNEL__

2015-09-09 Thread Palmer Dabbelt
This one scares me: while I can't find any system calls that directly
take this as an argument, a comment in 

  "
   Generic ptrace interface that exports the architecture specific
   regsets using the corresponding NT_* types (which are also used in
   the core dump).  Please note that the NT_PRSTATUS note type in a
   core dump contains a full 'struct elf_prstatus'. But the
   user_regset for NT_PRSTATUS contains just the elf_gregset_t that is
   the pr_reg field of 'struct elf_prstatus'. For all the other
   user_regset flavors, the user_regset layout and the ELF core dump
   note payload are exactly the same layout.
  "

seems to indicate that it's possible to see this sometimes.  Since
this would only be visible to userspace in a somewhat convoluted
manner, I'm going to try and keep it as it was.

Signed-off-by: Palmer Dabbelt 
Reviewed-by: Andrew Waterman 
Reviewed-by: Albert Ou 
---
 include/uapi/linux/elfcore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/elfcore.h b/include/uapi/linux/elfcore.h
index 569737cfb557..f9320b588937 100644
--- a/include/uapi/linux/elfcore.h
+++ b/include/uapi/linux/elfcore.h
@@ -60,7 +60,7 @@ struct elf_prstatus
longpr_instr;   /* Current instruction */
 #endif
elf_gregset_t pr_reg;   /* GP registers */
-#ifdef CONFIG_BINFMT_ELF_FDPIC
+#if defined(__KERNEL__) && defined(CONFIG_BINFMT_ELF_FDPIC)
/* When using FDPIC, the loadmap addresses need to be communicated
 * to GDB in order for GDB to do the necessary relocations.  The
 * fields (below) used to communicate this information are placed
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/