aboutsummaryrefslogtreecommitdiff
path: root/libiberty/simple-object-elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty/simple-object-elf.c')
-rw-r--r--libiberty/simple-object-elf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libiberty/simple-object-elf.c b/libiberty/simple-object-elf.c
index 7eb3df8..c394924 100644
--- a/libiberty/simple-object-elf.c
+++ b/libiberty/simple-object-elf.c
@@ -196,6 +196,7 @@ typedef struct {
/* Values for sh_flags field. */
+#define SHF_EXECINSTR 0x00000004 /* Executable section. */
#define SHF_EXCLUDE 0x80000000 /* Link editor is to exclude this
section from executable and
shared library that it builds
@@ -1403,7 +1404,14 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
flags = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
shdr, sh_flags, Elf_Addr);
if (ret == 0)
- flags &= ~SHF_EXCLUDE;
+ {
+ /* The debugobj doesn't contain any code, thus no trampolines.
+ Even when the original object needs trampolines, debugobj
+ doesn't. */
+ if (strcmp (name, ".note.GNU-stack") == 0)
+ flags &= ~SHF_EXECINSTR;
+ flags &= ~SHF_EXCLUDE;
+ }
else if (ret == -1)
flags = SHF_EXCLUDE;
ELF_SET_FIELD (type_functions, ei_class, Shdr,