Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf, docs: Update llvm_relocs.rst with typo fixes

Correct a few typographical errors and fix some mistakes in examples.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230428023015.1698072-2-hawkinsw@obs.cr
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Will Hawkins and committed by
Alexei Starovoitov
69535186 fbc0b025

+9 -7
+9 -7
Documentation/bpf/llvm_reloc.rst
··· 48 48 14: 0f 10 00 00 00 00 00 00 r0 += r1 49 49 15: 95 00 00 00 00 00 00 00 exit 50 50 51 - There are four relations in the above for four ``LD_imm64`` instructions. 51 + There are four relocations in the above for four ``LD_imm64`` instructions. 52 52 The following ``llvm-readelf -r test.o`` shows the binary values of the four 53 53 relocations:: 54 54 ··· 79 79 The 6th entry is global variable ``g1`` with value 0. 80 80 81 81 Similarly, the second relocation is at ``.text`` offset ``0x18``, instruction 3, 82 - for global variable ``g2`` which has a symbol value 4, the offset 83 - from the start of ``.data`` section. 82 + has a type of ``R_BPF_64_64`` and refers to entry 7 in the symbol table. 83 + The second relocation resolves to global variable ``g2`` which has a symbol 84 + value 4. The symbol value represents the offset from the start of ``.data`` 85 + section where the initial value of the global variable ``g2`` is stored. 84 86 85 - The third and fourth relocations refers to static variables ``l1`` 86 - and ``l2``. From ``.rel.text`` section above, it is not clear 87 - which symbols they really refers to as they both refers to 87 + The third and fourth relocations refer to static variables ``l1`` 88 + and ``l2``. From the ``.rel.text`` section above, it is not clear 89 + to which symbols they really refer as they both refer to 88 90 symbol table entry 4, symbol ``sec``, which has ``STT_SECTION`` type 89 - and represents a section. So for static variable or function, 91 + and represents a section. So for a static variable or function, 90 92 the section offset is written to the original insn 91 93 buffer, which is called ``A`` (addend). Looking at 92 94 above insn ``7`` and ``11``, they have section offset ``8`` and ``12``.