Changeset 3797 in CLRX


Ignore:
Timestamp:
Feb 15, 2018, 11:42:58 AM (17 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Fixes in GOT symbols support: add got section to relSpace and fixed setting target symbol in '.gotsym'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r3796 r3797  
    18331833    if (!targetSymName.empty())
    18341834    {
    1835         std::pair<AsmSymbolEntry*, bool> res = asmr.insertSymbolInScope(symName,
     1835        std::pair<AsmSymbolEntry*, bool> res = asmr.insertSymbolInScope(targetSymName,
    18361836                    AsmSymbol(handler.gotSection, gotSymbolIndex*8));
    18371837        if (!res.second)
     
    18391839            // if symbol found
    18401840            if (res.first->second.onceDefined && res.first->second.isDefined()) // if label
    1841                 asmr.printError(symNamePlace, (std::string("Symbol '")+symName.c_str()+
    1842                             "' is already defined").c_str());
     1841                asmr.printError(symNamePlace, (std::string("Symbol '")+
     1842                            targetSymName.c_str()+ "' is already defined").c_str());
    18431843            else // set value of symbol
    18441844                asmr.setSymbol(*res.first, gotSymbolIndex*8, handler.gotSection);
     
    26532653                    binGen->getSectionOffset(ELFSECTID_TEXT);
    26542654       
    2655         Array<cxuint> relSections(1 + (dataSection != ASMSECT_ABS));
     2655        Array<cxuint> relSections(1 + (dataSection != ASMSECT_NONE) +
     2656                    (gotSection != ASMSECT_NONE));
    26562657        cxuint relSectionId = 0;
    2657         if (dataSection != ASMSECT_ABS)
     2658        if (dataSection != ASMSECT_NONE)
    26582659        {
    26592660            assembler.sections[dataSection].relAddress =
     
    26622663        }
    26632664        relSections[relSectionId++] = codeSection;
     2665        if (gotSection != ASMSECT_NONE)
     2666        {
     2667            assembler.sections[gotSection].relAddress =
     2668                    binGen->getSectionOffset(ROCMSECTID_GOT);
     2669            relSections[relSectionId++] = gotSection;
     2670        }
    26642671        assembler.relSpacesSections.push_back(std::move(relSections));
    26652672    }
Note: See TracChangeset for help on using the changeset viewer.