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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    /****
Note: See TracChangeset for help on using the changeset viewer.