1
0
Fork 0
alistair23-linux/Documentation
Jiri Slaby 840d8c9b3e linkage: Introduce new macros for assembler symbols
commit ffedeeb780 upstream.

Introduce new C macros for annotations of functions and data in
assembly. There is a long-standing mess in macros like ENTRY, END,
ENDPROC and similar. They are used in different manners and sometimes
incorrectly.

So introduce macros with clear use to annotate assembly as follows:

a) Support macros for the ones below
   SYM_T_FUNC -- type used by assembler to mark functions
   SYM_T_OBJECT -- type used by assembler to mark data
   SYM_T_NONE -- type used by assembler to mark entries of unknown type

   They are defined as STT_FUNC, STT_OBJECT, and STT_NOTYPE
   respectively. According to the gas manual, this is the most portable
   way. I am not sure about other assemblers, so this can be switched
   back to %function and %object if this turns into a problem.
   Architectures can also override them by something like ", @function"
   if they need.

   SYM_A_ALIGN, SYM_A_NONE -- align the symbol?
   SYM_L_GLOBAL, SYM_L_WEAK, SYM_L_LOCAL -- linkage of symbols

b) Mostly internal annotations, used by the ones below
   SYM_ENTRY -- use only if you have to (for non-paired symbols)
   SYM_START -- use only if you have to (for paired symbols)
   SYM_END -- use only if you have to (for paired symbols)

c) Annotations for code
   SYM_INNER_LABEL_ALIGN -- only for labels in the middle of code
   SYM_INNER_LABEL -- only for labels in the middle of code

   SYM_FUNC_START_LOCAL_ALIAS -- use where there are two local names for
	one function
   SYM_FUNC_START_ALIAS -- use where there are two global names for one
	function
   SYM_FUNC_END_ALIAS -- the end of LOCAL_ALIASed or ALIASed function

   SYM_FUNC_START -- use for global functions
   SYM_FUNC_START_NOALIGN -- use for global functions, w/o alignment
   SYM_FUNC_START_LOCAL -- use for local functions
   SYM_FUNC_START_LOCAL_NOALIGN -- use for local functions, w/o
	alignment
   SYM_FUNC_START_WEAK -- use for weak functions
   SYM_FUNC_START_WEAK_NOALIGN -- use for weak functions, w/o alignment
   SYM_FUNC_END -- the end of SYM_FUNC_START_LOCAL, SYM_FUNC_START,
	SYM_FUNC_START_WEAK, ...

   For functions with special (non-C) calling conventions:
   SYM_CODE_START -- use for non-C (special) functions
   SYM_CODE_START_NOALIGN -- use for non-C (special) functions, w/o
	alignment
   SYM_CODE_START_LOCAL -- use for local non-C (special) functions
   SYM_CODE_START_LOCAL_NOALIGN -- use for local non-C (special)
	functions, w/o alignment
   SYM_CODE_END -- the end of SYM_CODE_START_LOCAL or SYM_CODE_START

d) For data
   SYM_DATA_START -- global data symbol
   SYM_DATA_START_LOCAL -- local data symbol
   SYM_DATA_END -- the end of the SYM_DATA_START symbol
   SYM_DATA_END_LABEL -- the labeled end of SYM_DATA_START symbol
   SYM_DATA -- start+end wrapper around simple global data
   SYM_DATA_LOCAL -- start+end wrapper around simple local data

==========

The macros allow to pair starts and ends of functions and mark functions
correctly in the output ELF objects.

All users of the old macros in x86 are converted to use these in further
patches.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Cc: x86-ml <x86@kernel.org>
Cc: xen-devel@lists.xenproject.org
Link: https://lkml.kernel.org/r/20191011115108.12392-2-jslaby@suse.cz
Cc: Jian Cai <jiancai@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-10 12:37:24 +01:00
..
ABI iio: improve IIO_CONCENTRATION channel type description 2020-08-19 08:16:07 +02:00
EDID docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
PCI Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-08-27 14:23:31 -07:00
RCU Merge branches 'consolidate.2019.08.01b', 'fixes.2019.08.12a', 'lists.2019.08.13a' and 'torture.2019.08.01b' into HEAD 2019-08-13 14:30:30 -07:00
accounting docs: add some documentation dirs to the driver-api book 2019-07-15 11:03:02 -03:00
admin-guide xen/events: defer eoi in case of excessive number of events 2020-11-05 11:43:12 +01:00
arm Documentation/arm/samsung-s3c24xx: Remove stray U+FEFF character to fix title 2019-08-12 15:25:32 -06:00
arm64 arm64: errata: Hide CTR_EL0.DIC on systems affected by Neoverse-N1 #1542419 2020-04-29 16:32:56 +02:00
block docs: block: null_blk: enhance document style 2019-09-11 16:04:22 -06:00
bpf bpf/flow_dissector: document flags 2019-07-25 18:00:41 -07:00
cdrom docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
core-api Modules fixes for v5.4-rc3 2019-10-11 10:19:24 -07:00
cpu-freq Documentation: cpufreq: Update policy notifier documentation 2019-09-02 22:44:05 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-09-18 12:11:14 -07:00
dev-tools mm, page_owner: decouple freeing stack trace from debug_pagealloc 2019-10-14 15:04:00 -07:00
devicetree gpio/aspeed-sgpio: enable access to all 80 input & output sgpios 2020-10-07 08:01:28 +02:00
doc-guide docs: remove extra conf.py files 2019-07-17 06:57:52 -03:00
driver-api ata: make qc_prep return ata_completion_errors 2020-10-01 13:18:26 +02:00
fault-injection docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
fb fbdev: fix numbering of fbcon options 2020-02-24 08:36:42 +01:00
features It's a somewhat calmer cycle for docs this time, as the churn of the mass 2019-09-17 16:22:26 -07:00
filesystems affs: fix basic permission bits to actually work 2020-09-09 19:12:34 +02:00
firmware-guide Documentation: ACPI: DSD: Convert LED documentation to ReST 2019-08-20 23:53:46 +02:00
firmware_class
fpga Documentation: fpga: dfl: add descriptions for virtualization and new interfaces. 2019-09-03 19:35:42 -07:00
gpu Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
hid docs: add some documentation dirs to the driver-api book 2019-07-15 11:03:02 -03:00
hwmon hwmon: docs: Extend inspur-ipsps1 title underline 2019-10-07 05:56:57 -07:00
i2c docs: i2c: convert to ReST and add to driver-api bookset 2019-07-31 13:25:27 -06:00
ia64 docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
ide docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
iio docs: add some documentation dirs to the driver-api book 2019-07-15 11:03:02 -03:00
infiniband Documentation/infiniband: update name of some functions 2019-09-13 16:55:55 -03:00
input Input: docs: fix spelling mistake "potocol" -> "protocol" 2019-08-06 11:24:49 -06:00
ioctl fs-verity: add UAPI header 2019-07-28 16:59:16 -07:00
isdn docs: isdn: convert to ReST and add to kAPI bookset 2019-07-31 13:30:25 -06:00
kbuild kbuild: support LLVM=1 to switch the default tools to Clang/LLVM 2020-08-26 10:40:47 +02:00
kernel-hacking docs: Add documentation for Symbol Namespaces 2019-09-10 10:30:49 +02:00
leds leds: core: Add support for composing LED class device names 2019-07-25 20:07:52 +02:00
livepatch docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
locking doc🔒 remove reference to clever use of read-write lock 2019-09-14 01:53:27 -06:00
m68k docs: README.buddha: convert to ReST and add to m68k book 2019-07-31 13:30:10 -06:00
maintainer docs: Fix typo on pull requests guide 2019-08-12 15:14:14 -06:00
media media: videodev2.h: RGB BT2020 and HSV are always full range 2020-11-05 11:43:15 +01:00
mic docs: driver-api: add remaining converted dirs to it 2019-07-15 11:03:03 -03:00
mips Main MIPS changes for v5.4: 2019-09-22 09:30:30 -07:00
misc-devices Docs: misc: xilinx_sdfec: Add documentation 2019-08-15 17:54:38 +02:00
netlabel docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
networking icmp: randomize the global rate limiter 2020-10-29 09:57:27 +01:00
nios2 docs: nios2: add it to the main Documentation body 2019-07-31 13:31:51 -06:00
openrisc docs: openrisc: convert to ReST and add to documentation body 2019-07-31 13:30:20 -06:00
parisc docs: parisc: convert to ReST and add to documentation body 2019-07-31 13:30:15 -06:00
pcmcia docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
power Merge branches 'pm-opp', 'pm-qos', 'acpi-pm', 'pm-domains' and 'pm-tools' 2019-09-17 09:49:19 +02:00
powerpc docs: powerpc: Add missing documentation reference 2019-09-17 23:59:34 +10:00
process Documentation/process: Add fallthrough pseudo-keyword 2019-10-11 09:26:05 -07:00
riscv It's a somewhat calmer cycle for docs this time, as the churn of the mass 2019-09-17 16:22:26 -07:00
s390 Documentation/s390: remove outdated debugging390 documentation 2019-08-21 12:41:43 +02:00
scheduler sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices 2019-08-08 09:09:30 +02:00
scsi scsi: smartpqi: Update attribute name to `driver_version` 2020-01-17 19:48:27 +01:00
security Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity 2019-09-27 19:37:27 -07:00
sh docs: remove extra conf.py files 2019-07-17 06:57:52 -03:00
sound ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups 2020-04-17 10:50:08 +02:00
sparc docs: add arch doc directories to the index 2019-07-15 11:03:01 -03:00
sphinx Documentation: sphinx: Don't parse socket() as identifier reference 2019-08-12 14:55:30 -06:00
sphinx-static
spi spi: docs: convert to ReST and add it to the kABI bookset 2019-07-31 14:13:13 -06:00
target docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
timers docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
trace Tracing updates: 2019-09-20 11:19:48 -07:00
translations doc: arm64: fix grammar dtb placed in no attributes region 2019-09-06 08:44:34 -06:00
usb USB: rio500: Remove Rio 500 kernel driver 2019-10-04 10:53:36 +02:00
userspace-api docs: remove extra conf.py files 2019-07-17 06:57:52 -03:00
virt x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit 2020-06-22 09:30:57 +02:00
virtual cpuidle: add haltpoll governor 2019-07-30 17:27:37 +02:00
vm mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
w1 docs: w1: convert to ReST and add to the kAPI group of docs 2019-07-31 14:16:17 -06:00
watchdog linux-watchdog 5.4-rc1 tag 2019-09-27 11:17:38 -07:00
x86 x86/speculation/taa: Add documentation for TSX Async Abort 2019-10-28 08:37:00 +01:00
xtensa docs: add arch doc directories to the index 2019-07-15 11:03:01 -03:00
.gitignore
COPYING-logo docs: logo.txt: rename it to COPYING-logo 2019-07-15 09:20:27 -03:00
Changes
CodingStyle
DMA-API-HOWTO.txt docs: DMA-API-HOWTO.txt: fix an unmarked code block 2019-07-15 09:20:24 -03:00
DMA-API.txt dma-mapping: remove dma_release_declared_memory 2019-09-04 11:13:19 +02:00
DMA-ISA-LPC.txt Documentation/DMA-ISA-LPC: fix an incorrect reference 2019-02-11 08:23:07 -07:00
DMA-attributes.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
Kconfig docs: Kbuild/Makefile: allow check for missing docs at build time 2019-06-07 11:33:16 -06:00
Makefile docs: Kbuild/Makefile: allow check for missing docs at build time 2019-06-07 11:33:16 -06:00
SubmittingPatches
asm-annotations.rst linkage: Introduce new macros for assembler symbols 2020-11-10 12:37:24 +01:00
atomic_bitops.txt docs: atomic_bitops.txt: add a title for this document 2019-04-11 12:37:02 -06:00
atomic_t.txt Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 16:12:03 -07:00
bus-virt-phys-mapping.txt
conf.py docs: conf.py: only use CJK if the font is available 2019-07-17 06:57:51 -03:00
crc32.txt
debugging-modules.txt
debugging-via-ohci1394.txt
digsig.txt
docutils.conf doc-rst: Add missing newline at end of file 2019-06-20 14:16:56 -06:00
dontdiff kbuild: create *.mod with full directory path and remove MODVERDIR 2019-07-18 02:19:31 +09:00
futex-requeue-pi.txt
hwspinlock.txt hwspinlock: add the 'in_atomic' API 2019-06-29 21:08:14 -07:00
index.rst linkage: Introduce new macros for assembler symbols 2020-11-10 12:37:24 +01:00
io-mapping.txt
io_ordering.txt
irqflags-tracing.txt
kobject.txt
kprobes.txt Merge branch 'parisc-5.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2019-05-07 19:34:17 -07:00
kref.txt
logo.gif
lzo.txt lib/lzo: fix ambiguous encoding bug in lzo-rle 2020-06-17 16:40:28 +02:00
mailbox.txt
memory-barriers.txt docs: fix broken doc references due to renames 2019-07-17 06:57:51 -03:00
nommu-mmap.txt
padata.txt padata: allocate workqueue internally 2019-09-13 21:15:39 +10:00
percpu-rw-semaphore.txt
pi-futex.txt docs: locking: convert docs to ReST and rename to *.rst 2019-07-15 08:53:27 -03:00
preempt-locking.txt x86/fpu: Remove fpu__restore() 2019-04-09 19:27:42 +02:00
rbtree.txt docs: rbtree.txt: fix Sphinx build warnings 2019-07-15 09:20:24 -03:00
remoteproc.txt remoteproc: add vendor resources handling 2019-06-29 12:02:17 -07:00
robust-futex-ABI.txt
robust-futexes.txt futex: Update comments and docs about return values of arch futex code 2019-04-26 13:57:55 +01:00
rpmsg.txt
speculation.txt docs: speculation.txt: mark example blocks as such 2019-04-11 12:37:03 -06:00
static-keys.txt static_keys.txt: Fix trivial spelling mistake 2019-02-06 16:44:16 -07:00
tee.txt Documentation: tee: Grammar s/the its/its/ 2019-06-07 11:23:38 -06:00
this_cpu_ops.txt
unaligned-memory-access.txt docs: unaligned-memory-access.txt: use a lowercase title 2019-04-11 12:37:03 -06:00
xz.txt