diff --git a/sdk/tools/obj2bin/obj2bin.c b/sdk/tools/obj2bin/obj2bin.c index 3f49775b1d4..4f6149a4718 100644 --- a/sdk/tools/obj2bin/obj2bin.c +++ b/sdk/tools/obj2bin/obj2bin.c @@ -140,8 +140,9 @@ int main(int argc, char *argv[]) /* Loop all sections */ for (i = 0; i < pFileHeader->NumberOfSections; i++) { - /* Check if this is '.text' section */ - if ((strcmp((char*)pSectionHeader->Name, ".text") == 0) && + /* Check if this is a section with executable code */ + if (((pSectionHeader->Characteristics & (IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE)) == + (IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE)) && (pSectionHeader->SizeOfRawData != 0)) { if (!RelocateSection(pData,