Changeset 2576 in CLRX


Ignore:
Timestamp:
Nov 16, 2016, 10:16:41 PM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCmBinGen: Adding extra sections and symbols to binary.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdbin/ROCmBinaries.h

    r2535 r2576  
    145145 */
    146146
     147enum: cxuint {
     148    ROCMSECTID_HASH = ELFSECTID_OTHER_BUILTIN,
     149    ROCMSECTID_DYNAMIC,
     150    ROCMSECTID_NOTE,
     151    ROCMSECTID_GPUCONFIG,
     152    ROCMSECTID_MAX = ROCMSECTID_GPUCONFIG
     153};
     154
    147155/// ROCm binary symbol input
    148156struct ROCmSymbolInput
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r2573 r2576  
    191191    uint32_t minor;
    192192    uint32_t stepping;
     193};
     194
     195// section index for symbol binding
     196static const uint16_t mainBuiltinSectionTable[] =
     197{
     198    10, // ELFSECTID_SHSTRTAB
     199    11, // ELFSECTID_STRTAB
     200    9, // ELFSECTID_SYMTAB
     201    3, // ELFSECTID_DYNSTR
     202    1, // ELFSECTID_DYNSYM
     203    4, // ELFSECTID_TEXT
     204    SHN_UNDEF, // ELFSECTID_RODATA
     205    SHN_UNDEF, // ELFSECTID_DATA
     206    SHN_UNDEF, // ELFSECTID_BSS
     207    8, // ELFSECTID_COMMENT
     208    2, // ROCMSECTID_HASH
     209    5, // ROCMSECTID_DYNAMIC
     210    6, // ROCMSECTID_NOTE
     211    7 // ROCMSECTID_GPUCONFIG
    193212};
    194213
     
    217236    { 8, 0, 4 } // GPUDeviceType::BAFFIN
    218237};
    219 
    220238
    221239void ROCmBinGenerator::generateInternal(std::ostream* osPtr, std::vector<char>* vPtr,
     
    311329    elfBinGen64.addRegion(ElfRegion64::sectionHeaderTable());
    312330   
     331    /* extra sections */
     332    for (const BinSection& section: input->extraSections)
     333        elfBinGen64.addRegion(ElfRegion64(section, mainBuiltinSectionTable,
     334                         ROCMSECTID_MAX, 12));
     335    /* extra symbols */
     336    for (const BinSymbol& symbol: input->extraSymbols)
     337        elfBinGen64.addSymbol(ElfSymbol64(symbol, mainBuiltinSectionTable,
     338                         ROCMSECTID_MAX, 12));
     339   
    313340    size_t binarySize = elfBinGen64.countSize();
    314341    /****
  • CLRadeonExtender/trunk/tests/amdbin/ROCmBinGen.cpp

    r2575 r2576  
    102102{
    103103    Array<cxbyte> inputData;
    104    
    105104    Array<cxbyte> output;
    106105    std::string origBinFilenameStr(origBinaryFilename);
Note: See TracChangeset for help on using the changeset viewer.