Skip to content

Commit 8c589bc

Browse files
committed
Document link_section arbitrary bytes
1 parent d56128d commit 8c589bc

File tree

1 file changed

+3
-0
lines changed
  • src/librustc_typeck/check

1 file changed

+3
-0
lines changed

src/librustc_typeck/check/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,9 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt<'_>, id: DefId, span: Span)
14471447
// other executable formats. Namely we can only embed a list of bytes,
14481448
// nothing with pointers to anything else or relocations. If any relocation
14491449
// show up, reject them here.
1450+
// #[link_section] may contain arbitrary, or even undefined bytes, but it is
1451+
// the consumer's responsibility to ensure all bytes that have been read
1452+
// have defined values.
14501453
let instance = ty::Instance::mono(tcx, id);
14511454
let cid = GlobalId {
14521455
instance,

0 commit comments

Comments
 (0)