Skip to content

Global Variable __remill_state on Windows #677

@Pigrecos

Description

@Pigrecos

I compiled on windows using LLVM ver. 16.0.4 the amd64 semantics files (for example) with these changes to the BCCompiler.cmake file:

set(DEFAULT_BC_COMPILER_FLAGS
   -emit-llvm -Wno-unknown-warning-option -Wall -Wshadow
   -Wconversion -Wpadded -pedantic -Wshorten-64-to-32 -Wgnu-alignof-expression
   -Wno-gnu-anonymous-struct -Wno-return-type-c-linkage
   -Wno-gnu-zero-variadic-macro-arguments -Wno-nested-anon-types
   -Wno-extended-offsetof -Wno-gnu-statement-expression -Wno-c99-extensions
   -Wno-ignored-attributes -fno-vectorize -fno-slp-vectorize
   -Wno-variadic-macros -Wno-c11-extensions -Wno-c++11-extensions
   -ffreestanding -fno-common -fno-builtin -fno-rtti
   -fno-asynchronous-unwind-tables -Wno-unneeded-internal-declaration
   -Wno-unused-function -Wgnu-inline-cpp-without-extern -fms-extensions
   -Wno-pass-failed=transform-warning -fshort-wchar -Xclang -mlong-double-80
   ${EXTRA_BC_SYSROOT}
)

the result for the global variable __remill_state is:

@"?__remill_state@@3UState@@A" = dso_local global %struct.State zeroinitializer, align 16

instead of (compiled under ubuntu):

@__remill_state = dso_local global %struct.State zeroinitializer, align 16

apply the decoration to the name.

Of course it can't find the variable:

const auto *state_global = module->getGlobalVariable("__remill_state");

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions