Skip to content

Commit 799d22f

Browse files
committed
Translate untranslated lines in asm.md
1 parent 53790a3 commit 799d22f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/unsafe/asm.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,13 +646,25 @@ fn load_fpu_control_word(control: u16) {
646646
# }
647647
```
648648

649+
<!--
649650
## Labels
651+
-->
652+
## ラベル
650653

654+
<!--
651655
Any reuse of a named label, local or otherwise, can result in an assembler or linker error or may cause other strange behavior. Reuse of a named label can happen in a variety of ways including:
656+
-->
657+
名前つきラベルの再利用は、ローカルかそうでないかに関わらず、アセンブラやリンカのエラーを引き起こしたり、変な挙動の原因となります。
658+
名前つきラベルの再利用は以下のようなケースがあります:
652659

660+
<!--
653661
- explicitly: using a label more than once in one `asm!` block, or multiple times across blocks.
654662
- implicitly via inlining: the compiler is allowed to instantiate multiple copies of an `asm!` block, for example when the function containing it is inlined in multiple places.
655663
- implicitly via LTO: LTO can cause code from *other crates* to be placed in the same codegen unit, and so could bring in arbitrary labels.
664+
-->
665+
- 明示的再利用: 同じラベルを1つの`asm!`ブロック中で、または複数のブロック中で2回以上利用する場合です。
666+
- インライン化による暗黙の再利用: コンパイラは`asm!`ブロックの複数のコピーをインスタンス化する場合があります。例えば、`asm!`ブロックを含む関数が複数箇所でインライン化される場合です。
667+
- LTO(訳注: Link Time Optimizationの略)による暗黙の再利用: LTOは *他のクレート* のコードを同じコード生成単位に配置するため、同じ名前のラベルを持ち込む場合があります。
656668

657669
As a consequence, you should only use GNU assembler **numeric** [local labels] inside inline assembly code. Defining symbols in assembly code may lead to assembler and/or linker errors due to duplicate symbol definitions.
658670

0 commit comments

Comments
 (0)