comparison src/share/vm/utilities/elfFile.hpp @ 8710:9058789475af

7107135: Stack guard pages are no more protected after loading a shared library with executable stack Summary: Detect the execstack attribute of the loaded library and attempt to fix the stack guard using Safepoint op. Reviewed-by: dholmes, zgu Contributed-by: ioi.lam@oracle.com
author iklam
date Tue, 05 Mar 2013 13:55:56 -0800
parents b9a9ed0f8eeb
children de6a9e811145 e7cbc95179c4
comparison
equal deleted inserted replaced
8709:255c0a4cb4eb 8710:9058789475af
41 typedef Elf64_Off Elf_Off; 41 typedef Elf64_Off Elf_Off;
42 typedef Elf64_Addr Elf_Addr; 42 typedef Elf64_Addr Elf_Addr;
43 43
44 typedef Elf64_Ehdr Elf_Ehdr; 44 typedef Elf64_Ehdr Elf_Ehdr;
45 typedef Elf64_Shdr Elf_Shdr; 45 typedef Elf64_Shdr Elf_Shdr;
46 typedef Elf64_Phdr Elf_Phdr;
46 typedef Elf64_Sym Elf_Sym; 47 typedef Elf64_Sym Elf_Sym;
47 48
48 #if !defined(_ALLBSD_SOURCE) || defined(__APPLE__) 49 #if !defined(_ALLBSD_SOURCE) || defined(__APPLE__)
49 #define ELF_ST_TYPE ELF64_ST_TYPE 50 #define ELF_ST_TYPE ELF64_ST_TYPE
50 #endif 51 #endif
57 typedef Elf32_Addr Elf_Addr; 58 typedef Elf32_Addr Elf_Addr;
58 59
59 60
60 typedef Elf32_Ehdr Elf_Ehdr; 61 typedef Elf32_Ehdr Elf_Ehdr;
61 typedef Elf32_Shdr Elf_Shdr; 62 typedef Elf32_Shdr Elf_Shdr;
63 typedef Elf32_Phdr Elf_Phdr;
62 typedef Elf32_Sym Elf_Sym; 64 typedef Elf32_Sym Elf_Sym;
63 65
64 #if !defined(_ALLBSD_SOURCE) || defined(__APPLE__) 66 #if !defined(_ALLBSD_SOURCE) || defined(__APPLE__)
65 #define ELF_ST_TYPE ELF32_ST_TYPE 67 #define ELF_ST_TYPE ELF32_ST_TYPE
66 #endif 68 #endif
121 123
122 protected: 124 protected:
123 ElfFile* next() const { return m_next; } 125 ElfFile* next() const { return m_next; }
124 void set_next(ElfFile* file) { m_next = file; } 126 void set_next(ElfFile* file) { m_next = file; }
125 127
128 public:
129 // Returns true if the elf file is marked NOT to require an executable stack,
130 // or if the file could not be opened.
131 // Returns false if the elf file requires an executable stack, the stack flag
132 // is not set at all, or if the file can not be read.
133 // On systems other than linux it always returns false.
134 bool specifies_noexecstack() NOT_LINUX({ return false; });
135
126 protected: 136 protected:
127 ElfFile* m_next; 137 ElfFile* m_next;
128 138
129 private: 139 private:
130 // file 140 // file