From e092473be1cf48216085f8349677cefc8f19b3b2 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 11 Feb 2022 09:14:17 +0100 Subject: document the automatic use of bss --- doc/il.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/il.txt b/doc/il.txt index 8713e0d..994729e 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -224,12 +224,15 @@ the section flag is platform dependent and we refer the user to the documentation of their assembler and linker for relevant information. - export section ".bss" - data $zerobuf = { z 1024 } + section ".init_array" + data $.init.f = { l $f } -Example uses of the section flag include adding function -pointers to a global initialization list, or storing a -zeroed object in the BSS section, as depicted above. +The section flag can be used to add function pointers to +a global initialization list, as depicted above. Note +that some platforms provide a BSS section that can be +used to minimize the footprint of uniformly zeroed data. +When this section is available, QBE will automatically +make use of it and no section flag is required. The section and export linkage flags should each appear at most once in a definition. If multiple occurrences @@ -244,7 +247,7 @@ data, and functions. Aggregate types are never exported and do not compile to any code. Data and function definitions have file scope and are mutually recursive (even across IL files). Their visibility can be controlled -using the `export` keyword. +using linkage flags. ~ Aggregate Types ~~~~~~~~~~~~~~~~~ -- cgit 1.4.1