Ignore:
Timestamp:
Nov 16, 2016, 4:33:50 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: ElfBinGen?: Add handling PHREGION_FILESTART to addrRegionStart.
ROCmBinGen: Fixing differences between original file and generated file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r2561 r2564  
    242242    }
    243243   
    244     ElfBinaryGen64 elfBinGen64({ 0U, 0U, 0x40, EV_CURRENT, ET_DYN,
    245         0xe0, EV_CURRENT, 0, 0, 0 });
     244    ElfBinaryGen64 elfBinGen64({ 0U, 0U, 0x40, 0, ET_DYN,
     245        0xe0, EV_CURRENT, UINT_MAX, 0, 0 }, true, true, true, PHREGION_FILESTART);
    246246    // add symbols
    247247    elfBinGen64.addDynSymbol(ElfSymbol64("_DYNAMIC", 5,
     
    273273    elfBinGen64.addProgramHeader({ PT_DYNAMIC, PF_R|PF_W, 5, 1, true, 0, 0, 0, 8 });
    274274    elfBinGen64.addProgramHeader({ PT_GNU_RELRO, PF_R, 5, 1, true, 0, 0, 0, 1 });
    275     elfBinGen64.addProgramHeader({ PT_GNU_STACK, PF_R|PF_W, 0, 0, true, 0, 0, 0 });
     275    elfBinGen64.addProgramHeader({ PT_GNU_STACK, PF_R|PF_W, PHREGION_FILESTART, 0,
     276                    true, 0, 0, 0 });
    276277   
    277278    // elf notes
     
    286287    /// region and sections
    287288    elfBinGen64.addRegion(ElfRegion64::programHeaderTable());
    288     elfBinGen64.addRegion(ElfRegion64::dynsymSection());
    289     elfBinGen64.addRegion(ElfRegion64::hashSection(1));
    290     elfBinGen64.addRegion(ElfRegion64::dynstrSection());
     289    elfBinGen64.addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 8,
     290                ".dynsym", SHT_DYNSYM, SHF_ALLOC, 0, 1, Elf64Types::nobase));
     291    elfBinGen64.addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 4,
     292                ".hash", SHT_HASH, SHF_ALLOC, 1, 0, Elf64Types::nobase));
     293    elfBinGen64.addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 1, ".dynstr", SHT_STRTAB,
     294                SHF_ALLOC, 0, 0, Elf64Types::nobase));
    291295    elfBinGen64.addRegion(ElfRegion64(input->codeSize, (const cxbyte*)input->code,
    292               0x1000, ".text", SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR, 0, 0, 0, 0,
    293               false, 256));
    294     elfBinGen64.addRegion(ElfRegion64::dynamicSection(3));
     296              0x1000, ".text", SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR, 0, 0,
     297              Elf64Types::nobase, 0, false, 256));
     298    elfBinGen64.addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 0x1000,
     299                ".dynamic", SHT_DYNAMIC, SHF_ALLOC|SHF_WRITE, 3, 0,
     300                Elf64Types::nobase, 0, false, 8));
    295301    elfBinGen64.addRegion(ElfRegion64::noteSection());
    296302    elfBinGen64.addRegion(ElfRegion64(commentSize, (const cxbyte*)comment, 1, ".comment",
    297               SHT_PROGBITS, SHF_MERGE|SHF_STRINGS));
    298     elfBinGen64.addRegion(ElfRegion64::symtabSection());
     303              SHT_PROGBITS, SHF_MERGE|SHF_STRINGS, 0, 0, 0, 1));
     304    elfBinGen64.addRegion(ElfRegion64(0, (const cxbyte*)nullptr, 8,
     305                ".symtab", SHT_SYMTAB, 0, 0, 1));
    299306    elfBinGen64.addRegion(ElfRegion64::shstrtabSection());
    300307    elfBinGen64.addRegion(ElfRegion64::strtabSection());
Note: See TracChangeset for help on using the changeset viewer.