diff --git a/src/coreclr/pal/inc/unixasmmacrosamd64.inc b/src/coreclr/pal/inc/unixasmmacrosamd64.inc index 2aca375faa8383..bb1e70a27bef02 100644 --- a/src/coreclr/pal/inc/unixasmmacrosamd64.inc +++ b/src/coreclr/pal/inc/unixasmmacrosamd64.inc @@ -52,6 +52,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro NOP_6_BYTE diff --git a/src/coreclr/pal/inc/unixasmmacrosarm.inc b/src/coreclr/pal/inc/unixasmmacrosarm.inc index d323ccc49fbd2d..f5eb32656cd3ae 100644 --- a/src/coreclr/pal/inc/unixasmmacrosarm.inc +++ b/src/coreclr/pal/inc/unixasmmacrosarm.inc @@ -40,6 +40,8 @@ C_FUNC(\Name): .global C_FUNC(\Name\()_End) C_FUNC(\Name\()_End): LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PREPARE_EXTERNAL_VAR Name, HelperReg diff --git a/src/coreclr/pal/inc/unixasmmacrosarm64.inc b/src/coreclr/pal/inc/unixasmmacrosarm64.inc index 9545afb9f8e584..8b3c5803b7d71f 100644 --- a/src/coreclr/pal/inc/unixasmmacrosarm64.inc +++ b/src/coreclr/pal/inc/unixasmmacrosarm64.inc @@ -44,6 +44,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PREPARE_EXTERNAL_VAR Name, HelperReg diff --git a/src/coreclr/pal/inc/unixasmmacrosx86.inc b/src/coreclr/pal/inc/unixasmmacrosx86.inc index 87cbddd6eda204..7bc994a779c356 100644 --- a/src/coreclr/pal/inc/unixasmmacrosx86.inc +++ b/src/coreclr/pal/inc/unixasmmacrosx86.inc @@ -33,6 +33,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PROLOG_BEG diff --git a/src/coreclr/vm/amd64/AsmMacros.inc b/src/coreclr/vm/amd64/AsmMacros.inc index 32d8ecb4fe70ed..2d14b9c31e8fca 100644 --- a/src/coreclr/vm/amd64/AsmMacros.inc +++ b/src/coreclr/vm/amd64/AsmMacros.inc @@ -133,12 +133,13 @@ Section ends LEAF_END_MARKED macro Name, section public Name&_End Name&_End label qword + +Name endp + ; this nop is important to keep the label in ; the right place in the face of BBT nop -Name endp - Section ends endm diff --git a/src/coreclr/vm/arm/asmmacros.h b/src/coreclr/vm/arm/asmmacros.h index ad3826cd8b2e1d..2c07bfb3fd00c8 100644 --- a/src/coreclr/vm/arm/asmmacros.h +++ b/src/coreclr/vm/arm/asmmacros.h @@ -29,6 +29,9 @@ __EndLabelName SETS "$FuncName":CC:"_End" LEAF_END $FuncName + ; Make sure this symbol gets its own address + nop + MEND ;----------------------------------------------------------------------------- diff --git a/src/coreclr/vm/arm64/asmmacros.h b/src/coreclr/vm/arm64/asmmacros.h index fae7ec3309aeec..bd19b9e6dc3dc5 100644 --- a/src/coreclr/vm/arm64/asmmacros.h +++ b/src/coreclr/vm/arm64/asmmacros.h @@ -147,6 +147,9 @@ __EndLabelName SETS "$FuncName":CC:"_End" LEAF_END $FuncName + ; make sure this symbol gets its own address + nop + MEND ;----------------------------------------------------------------------------- ; Macro use for enabling C++ to know where to patch code at runtime. diff --git a/src/coreclr/vm/i386/AsmMacros.inc b/src/coreclr/vm/i386/AsmMacros.inc index ac77064f0da5cc..ba6cc7e81a2854 100644 --- a/src/coreclr/vm/i386/AsmMacros.inc +++ b/src/coreclr/vm/i386/AsmMacros.inc @@ -38,6 +38,8 @@ LEAF_END_MARKED macro functionName %endMarkerName: PUBLIC endMarkerName functionName ENDP + ; make sure this symbol gets its own address + nop endm PATCH_LABEL macro labelName