Lines 652-658
Link Here
|
652 |
if (I64) |
652 |
if (I64) |
653 |
{ |
653 |
{ |
654 |
static char section_names_init64[] = |
654 |
static char section_names_init64[] = |
655 |
"\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.rela.text\0.rela.data"; |
655 |
"\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"; |
656 |
#define NAMIDX_NONE 0 |
656 |
#define NAMIDX_NONE 0 |
657 |
#define NAMIDX_SYMTAB 1 // .symtab |
657 |
#define NAMIDX_SYMTAB 1 // .symtab |
658 |
#define NAMIDX_STRTAB 9 // .strtab |
658 |
#define NAMIDX_STRTAB 9 // .strtab |
Lines 663-671
Link Here
|
663 |
#define NAMIDX_NOTE 44 // .note |
663 |
#define NAMIDX_NOTE 44 // .note |
664 |
#define NAMIDX_COMMENT 50 // .comment |
664 |
#define NAMIDX_COMMENT 50 // .comment |
665 |
#define NAMIDX_RODATA 59 // .rodata |
665 |
#define NAMIDX_RODATA 59 // .rodata |
666 |
#define NAMIDX_RELTEXT 67 // .rel.text and .rela.text |
666 |
#define NAMIDX_GNUSTACK 67 // .note.GNU-stack |
667 |
#define NAMIDX_RELDATA 77 // .rel.data |
667 |
#define NAMIDX_RELTEXT 83 // .rel.text and .rela.text |
668 |
#define NAMIDX_RELDATA64 78 // .rela.data |
668 |
#define NAMIDX_RELDATA 93 // .rel.data |
|
|
669 |
#define NAMIDX_RELDATA64 94 // .rela.data |
669 |
|
670 |
|
670 |
if (section_names) |
671 |
if (section_names) |
671 |
section_names->setsize(sizeof(section_names_init64)); |
672 |
section_names->setsize(sizeof(section_names_init64)); |
Lines 692-697
Link Here
|
692 |
elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0); |
693 |
elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0); |
693 |
elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
694 |
elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
694 |
elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0); |
695 |
elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0); |
|
|
696 |
elf_newsection2(NAMIDX_GNUSTACK,SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
695 |
|
697 |
|
696 |
IDXSTR namidx; |
698 |
IDXSTR namidx; |
697 |
namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
699 |
namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
Lines 705-715
Link Here
|
705 |
namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
707 |
namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
706 |
namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
708 |
namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
707 |
namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
709 |
namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
|
|
710 |
namidx = NAMIDX_GNUSTACK; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
708 |
} |
711 |
} |
709 |
else |
712 |
else |
710 |
{ |
713 |
{ |
711 |
static char section_names_init[] = |
714 |
static char section_names_init[] = |
712 |
"\0.symtab\0.strtab\0.shstrtab\0.text\0.data\0.bss\0.note\0.comment\0.rodata\0.rel.text\0.rel.data"; |
715 |
"\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"; |
713 |
|
716 |
|
714 |
if (section_names) |
717 |
if (section_names) |
715 |
section_names->setsize(sizeof(section_names_init)); |
718 |
section_names->setsize(sizeof(section_names_init)); |
Lines 736-741
Link Here
|
736 |
elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0); |
739 |
elf_newsection2(NAMIDX_SHSTRTAB,SHT_STRTAB, 0, 0,0,0,0,0, 1,0); |
737 |
elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
740 |
elf_newsection2(NAMIDX_COMMENT, SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
738 |
elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0); |
741 |
elf_newsection2(NAMIDX_NOTE,SHT_NOTE, 0, 0,0,0,0,0, 1,0); |
|
|
742 |
elf_newsection2(NAMIDX_GNUSTACK,SHT_PROGDEF,0, 0,0,0,0,0, 1,0); |
739 |
|
743 |
|
740 |
IDXSTR namidx; |
744 |
IDXSTR namidx; |
741 |
namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
745 |
namidx = NAMIDX_TEXT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
Lines 749-754
Link Here
|
749 |
namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
753 |
namidx = NAMIDX_SHSTRTAB; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
750 |
namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
754 |
namidx = NAMIDX_COMMENT; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
751 |
namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
755 |
namidx = NAMIDX_NOTE; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
|
|
756 |
namidx = NAMIDX_GNUSTACK; *(IDXSTR *)section_names_hashtable->get(&namidx) = namidx; |
752 |
} |
757 |
} |
753 |
|
758 |
|
754 |
if (SYMbuf) |
759 |
if (SYMbuf) |