Skip to content

Commit 942d8bb

Browse files
committed
Translate untranslated lines in asm.md
1 parent 799d22f commit 942d8bb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/unsafe/asm.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,20 @@ Any reuse of a named label, local or otherwise, can result in an assembler or li
666666
- インライン化による暗黙の再利用: コンパイラは`asm!`ブロックの複数のコピーをインスタンス化する場合があります。例えば、`asm!`ブロックを含む関数が複数箇所でインライン化される場合です。
667667
- LTO(訳注: Link Time Optimizationの略)による暗黙の再利用: LTOは *他のクレート* のコードを同じコード生成単位に配置するため、同じ名前のラベルを持ち込む場合があります。
668668

669+
<!--
669670
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.
671+
-->
672+
そのため、インラインアセンブリコードの中では、GNUアセンブラの **数値型** [ローカルラベル][local labels]のみ使用してください。
673+
アセンブリコード内でシンボルを定義すると、シンボル定義の重複により、アセンブラやリンカのエラーが発生する可能性があります。
670674

675+
<!--
671676
Moreover, on x86 when using the default Intel syntax, due to [an LLVM bug], you shouldn't use labels exclusively made of `0` and `1` digits, e.g. `0`, `11` or `101010`, as they may end up being interpreted as binary values. Using `options(att_syntax)` will avoid any ambiguity, but that affects the syntax of the _entire_ `asm!` block. (See [Options](#options), below, for more on `options`.)
677+
-->
678+
さらに、x86でデフォルトのIntel構文を使用する場合、[LLVMのバグ][an LLVM bug]によって、
679+
`0``11``101010`といった`0``1`だけで構成されたラベルは、
680+
バイナリ値として解釈されてしまうため、使用してはいけません。
681+
`options(att_syntax)`を使うと曖昧さを避けられますが、`asm!`ブロック _全体_ の構文に影響します。
682+
(`options`については、後述の[オプション](#options)を参照してください。)
672683

673684
```rust
674685
# #[cfg(target_arch = "x86_64")] {

0 commit comments

Comments
 (0)