Changeset 2545 in CLRX


Ignore:
Timestamp:
Nov 6, 2016, 9:51:58 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add empty constructors for ElfSymbolXX and ElfRegionXX.
ROCmBinGen: adding symbols to binary.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r2544 r2545  
    503503    } section;  ///< section structure
    504504   
     505    ElfRegionTemplate() : type(ElfRegionType::USER), dataFromPointer(false), size(0),
     506              align(0), data(0)
     507    { }
    505508    /// constructor for user region
    506509    ElfRegionTemplate(typename Types::Word _size,
     
    651654    typename Types::Word value;  ///< symbol value
    652655    typename Types::Word size;   ///< symbol size
     656   
     657    ElfSymbolTemplate() : name(nullptr), sectionIndex(0), info(0), other(0),
     658          valueIsAddr(false), value(0), size(0)
     659    { }
    653660   
    654661    /// constructor (to replace initializer list construction)
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r2538 r2545  
    193193   
    194194    ElfBinaryGen64 elfBinGen64;
     195    // add symbols
     196    elfBinGen64.addDynSymbol(ElfSymbol64("_DYNAMIC", 5,
     197                  ELF64_ST_INFO(STB_LOCAL, STT_NOTYPE), STV_HIDDEN, true, 0, 0));
     198    for (const ROCmSymbolInput& symbol: input->symbols)
     199    {
     200        ElfSymbol64 elfsym;
     201        if (symbol.isKernel)
     202            elfsym = ElfSymbol64(symbol.symbolName.c_str(), 4,
     203                  ELF64_ST_INFO(STB_GLOBAL, STT_GNU_IFUNC), 0, true,
     204                  symbol.offset, symbol.size);
     205        else
     206            elfsym = ElfSymbol64(symbol.symbolName.c_str(), 4,
     207                  ELF64_ST_INFO(STB_GLOBAL, STT_NOTYPE), 0, true,
     208                  symbol.offset, symbol.size);
     209        elfBinGen64.addSymbol(elfsym);
     210        elfBinGen64.addDynSymbol(elfsym);
     211    }
     212   
    195213    elfBinGen64.addRegion(ElfRegion64::programHeaderTable());
    196214    elfBinGen64.addRegion(ElfRegion64::dynsymSection());
Note: See TracChangeset for help on using the changeset viewer.