Ignore:
Timestamp:
Feb 15, 2018, 12:04:57 AM (22 months ago)
Author:
matszpk
Message:

CLRadeonExtender: ElfBinGen?: Fixed counting region alignment (like in generate routine). Fixed including addrBase in elf header program entry.
ROCm: First working (not fully) version with got symbols. Fixed ROCm binaries for test (program entry).

File:
1 edited

Legend:

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

    r3794 r3796  
    21102110        eflags = input->eflags;
    21112111   
    2112     elfBinGen64.reset(new ElfBinaryGen64({ 0U, 0U, 0x40, 0, ET_DYN,
    2113             0xe0, EV_CURRENT, UINT_MAX, 0, eflags },
    2114             true, true, true, PHREGION_FILESTART));
    2115    
    21162112    std::fill(mainBuiltinSectTable,
    21172113              mainBuiltinSectTable + ROCMSECTID_MAX-ELFSECTID_START+1, SHN_UNDEF);
     
    21422138    addMainSectionToTable(mainSectionsNum, mainBuiltinSectTable, ELFSECTID_SHSTRTAB);
    21432139    addMainSectionToTable(mainSectionsNum, mainBuiltinSectTable, ELFSECTID_STRTAB);
     2140   
     2141    elfBinGen64.reset(new ElfBinaryGen64({ 0U, 0U, 0x40, 0, ET_DYN, 0xe0, EV_CURRENT,
     2142            cxuint(input->newBinFormat ? execProgHeaderRegionIndex : UINT_MAX), 0, eflags },
     2143            true, true, true, PHREGION_FILESTART));
    21442144   
    21452145    static const int32_t dynTags[] = {
     
    22442244    if (!input->gotSymbols.empty())
    22452245    {
    2246         rocmRelaDynGen = new ROCmRelaDynGen(input);
     2246        ROCmRelaDynGen* sgen = new ROCmRelaDynGen(input);
     2247        rocmRelaDynGen = (void*)sgen;
    22472248        elfBinGen64->addRegion(ElfRegion64(input->gotSymbols.size()*sizeof(Elf64_Rela),
    2248                 (ElfRegionContent*)rocmRelaDynGen, 8, "rela.dyn",
    2249                 SHT_RELA, SHF_ALLOC, 0, 0,
     2249                sgen, 8, ".rela.dyn", SHT_RELA, SHF_ALLOC,
    22502250                mainBuiltinSectTable[ELFSECTID_DYNSYM-ELFSECTID_START], 0,
    22512251                Elf64Types::nobase, sizeof(Elf64_Rela)));
     
    22612261    if (!input->gotSymbols.empty())
    22622262    {
    2263         rocmGotGen = new ROCmGotGen(input);
    2264         elfBinGen64->addRegion(ElfRegion64(input->gotSymbols.size()*8,
    2265                 (ElfRegionContent*)rocmGotGen, 8, ".got", SHT_PROGBITS,
     2263        ROCmGotGen* sgen = new ROCmGotGen(input);
     2264        rocmGotGen = (void*)sgen;
     2265        elfBinGen64->addRegion(ElfRegion64(input->gotSymbols.size()*8, sgen,
     2266                8, ".got", SHT_PROGBITS,
    22662267                SHF_ALLOC|SHF_WRITE, 0, 0, Elf64Types::nobase));
    22672268    }
Note: See TracChangeset for help on using the changeset viewer.