updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / lib32-dmd / stackelf.patch
blobed6ced40146d266256ffdb28934d5ad1064970f1
1 --- dmd/src/dmd/backend/elfobj.c.old 2010-12-17 19:11:16.000000000 +0100
2 +++ dmd/src/dmd/backend/elfobj.c 2011-12-23 00:53:36.585240795 +0100
3 @@ -652,7 +652,7 @@
4 if (I64)
6 static char section_names_init64[] =
7 - "\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.rela.text\0.rela.data";
8 + "\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.note.GNU-stack\0.rela.text\0.rela.data";
9 #define NAMIDX_NONE 0
10 #define NAMIDX_SYMTAB 1 // .symtab
11 #define NAMIDX_STRTAB 9 // .strtab
12 @@ -663,9 +663,10 @@
13 #define NAMIDX_NOTE 44 // .note
14 #define NAMIDX_COMMENT 50 // .comment
15 #define NAMIDX_RODATA 59 // .rodata
16 - #define NAMIDX_RELTEXT 67 // .rel.text and .rela.text
17 - #define NAMIDX_RELDATA 77 // .rel.data
18 - #define NAMIDX_RELDATA64 78 // .rela.data
19 + #define NAMIDX_GNUSTACK 67 // .note.GNU-stack
20 + #define NAMIDX_RELTEXT 83 // .rel.text and .rela.text
21 + #define NAMIDX_RELDATA 93 // .rel.data
22 + #define NAMIDX_RELDATA64 94 // .rela.data
24 if (section_names)
25 section_names->setsize(sizeof(section_names_init64));
26 @@ -692,6 +693,7 @@
27 elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0);
28 elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0);
29 elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0);
30 + elf_newsection2(NAMIDX_GNUSTACK,SHT_PROGDEF,0, 0,0,0,0,0, 1,0);
32 IDXSTR namidx;
33 namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
34 @@ -705,11 +707,12 @@
35 namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
36 namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
37 namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
38 + namidx = NAMIDX_GNUSTACK; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
40 else
42 static char section_names_init[] =
43 - "\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.rel.text\0.rel.data";
44 + "\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.note.GNU-stack\0.rel.text\0.rel.data";
46 if (section_names)
47 section_names->setsize(sizeof(section_names_init));
48 @@ -736,6 +739,7 @@
49 elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0);
50 elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0);
51 elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0);
52 + elf_newsection2(NAMIDX_GNUSTACK,SHT_PROGDEF,0, 0,0,0,0,0, 1,0);
54 IDXSTR namidx;
55 namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
56 @@ -749,6 +753,7 @@
57 namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
58 namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
59 namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
60 + namidx = NAMIDX_GNUSTACK; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx;
63 if (SYMbuf)