Changeset View
Changeset View
Standalone View
Standalone View
llvm/docs/AMDGPUUsage.rst
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 845 Lines • ▼ Show 20 Lines | |||||
Symbols | Symbols | ||||
------- | ------- | ||||
Symbols include the following: | Symbols include the following: | ||||
.. table:: AMDGPU ELF Symbols | .. table:: AMDGPU ELF Symbols | ||||
:name: amdgpu-elf-symbols-table | :name: amdgpu-elf-symbols-table | ||||
===================== ============== ============= ================== | ===================== ================== ================ ================== | ||||
Name Type Section Description | Name Type Section Description | ||||
===================== ============== ============= ================== | ===================== ================== ================ ================== | ||||
*link-name* ``STT_OBJECT`` - ``.data`` Global variable | *link-name* ``STT_OBJECT`` - ``.data`` Global variable | ||||
- ``.rodata`` | - ``.rodata`` | ||||
- ``.bss`` | - ``.bss`` | ||||
*link-name*\ ``.kd`` ``STT_OBJECT`` - ``.rodata`` Kernel descriptor | *link-name*\ ``.kd`` ``STT_OBJECT`` - ``.rodata`` Kernel descriptor | ||||
*link-name* ``STT_FUNC`` - ``.text`` Kernel entry point | *link-name* ``STT_FUNC`` - ``.text`` Kernel entry point | ||||
===================== ============== ============= ================== | *link-name* ``STT_OBJECT`` - SHN_AMDGPU_LDS Global variable in LDS | ||||
===================== ================== ================ ================== | |||||
Global variable | Global variable | ||||
Global variables both used and defined by the compilation unit. | Global variables both used and defined by the compilation unit. | ||||
If the symbol is defined in the compilation unit then it is allocated in the | If the symbol is defined in the compilation unit then it is allocated in the | ||||
appropriate section according to if it has initialized data or is readonly. | appropriate section according to if it has initialized data or is readonly. | ||||
If the symbol is external then its section is ``STN_UNDEF`` and the loader | If the symbol is external then its section is ``STN_UNDEF`` and the loader | ||||
will resolve relocations using the definition provided by another code object | will resolve relocations using the definition provided by another code object | ||||
or explicitly defined by the runtime. | or explicitly defined by the runtime. | ||||
All global symbols, whether defined in the compilation unit or external, are | If the symbol resides in local/group memory (LDS) then its section is the | ||||
accessed by the machine code indirectly through a GOT table entry. This | special processor-specific section name ``SHN_AMDGPU_LDS``, and the | ||||
allows them to be preemptable. The GOT table is only supported when the target | ``st_value`` field describes alignment requirements as it does for common | ||||
triple OS is ``amdhsa`` (see :ref:`amdgpu-target-triples`). | symbols. | ||||
.. TODO | .. TODO | ||||
Add description of linked shared object symbols. Seems undefined symbols | Add description of linked shared object symbols. Seems undefined symbols | ||||
are marked as STT_NOTYPE. | are marked as STT_NOTYPE. | ||||
Kernel descriptor | Kernel descriptor | ||||
Every HSA kernel has an associated kernel descriptor. It is the address of the | Every HSA kernel has an associated kernel descriptor. It is the address of the | ||||
kernel descriptor that is used in the AQL dispatch packet used to invoke the | kernel descriptor that is used in the AQL dispatch packet used to invoke the | ||||
▲ Show 20 Lines • Show All 5,603 Lines • Show Last 20 Lines |