Skip to content

Commit 3cf8f2f

Browse files
committed
document min_global_align
1 parent 76d5c46 commit 3cf8f2f

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

src/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120

121121
- [Inline assembly](inline-assembly.md)
122122

123+
- [Target properties](target-properties.md)
124+
123125
- [Unsafety](unsafety.md)
124126
- [The `unsafe` keyword](unsafe-keyword.md)
125127
- [Behavior considered undefined](behavior-considered-undefined.md)

src/glossary.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ string slice type is `&str`, while the mutable string slice type is `&mut str`.
252252

253253
Strings slices are always valid UTF-8.
254254

255+
### Symbol
256+
257+
A symbol is a name used to refer to code or data in an executable format (e.g. ELF or Macho).
258+
259+
A `static` emits a data symbol, functions emit code symbols.
260+
255261
### Trait
256262

257263
A trait is a language item that is used for describing the functionalities a type must provide.

src/items/static-items.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ If the `static` has a size of at least 1 byte, this allocation is disjoint from
2424
immutable `static` items can overlap with allocations that do not themselves have a unique address, such
2525
as [promoteds] and [`const` items][constant].
2626

27+
r[items.static.symbol]
28+
A static item produces a data [symbol]. The visibility and mangling of the symbol name can be adjusted with
29+
attributes like [`no_mangle`] and [`export_name`].
30+
2731
r[items.static.namespace]
2832
The static declaration defines a static value in the [value namespace] of the module or block where it is located.
2933

@@ -168,3 +172,6 @@ following are true:
168172
[interior mutable]: ../interior-mutability.md
169173
[value namespace]: ../names/namespaces.md
170174
[promoteds]: ../destructors.md#constant-promotion
175+
[symbol]: ../glossary.md#symbol
176+
[`no_mangle`]: ../abi.md#the-no_mangle-attribute
177+
[`export_name`]: ../abi.md#the-export_name-attribute

src/target-properties.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
r[target-properties]
2+
# Target properties
3+
4+
r[target-properties.pointer-width]
5+
The size of a pointer in bits is equal to the `options.pointer_width` specified by the target.
6+
7+
r[target-properties.endianness]
8+
The endianness is equal to the `endian` specified by the target.
9+
10+
r[target-properties.min_global_align]
11+
Every data [symbol] is aligned to at least the `min_global_align` specified by the target.
12+
13+
[symbol]: glossary.md#symbol

0 commit comments

Comments
 (0)