linux/scripts/mod
Masahiro Yamada 5419aa2a8d modpost: use more reliable way to get fromsec in section_rel(a)()
The section name of Rel and Rela starts with ".rel" and ".rela"
respectively (but, I do not know whether this is specification or
convention).

For example, ".rela.text" holds relocation entries applied to the
".text" section.

So, the code chops the ".rel" or ".rela" prefix to get the name of
the section to which the relocation applies.

However, I do not like to skip 4 or 5 bytes blindly because it is
potential memory overrun.

The ELF specification provides a more reliable way to do this.

 - The sh_info field holds extra information, whose interpretation
   depends on the section type

 - If the section type is SHT_REL or SHT_RELA, the sh_info field holds
   the section header index of the section to which the relocation
   applies.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2022-08-03 22:58:10 +09:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
devicetable-offsets.c HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE() 2021-11-09 11:41:46 +01:00
empty.c
file2alias.c modpost: use sym_get_data() to get module device_table data 2022-07-27 21:18:00 +09:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
Makefile scripts/mod: disable LTO for empty.c 2021-01-14 08:21:09 -08:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c modpost: use more reliable way to get fromsec in section_rel(a)() 2022-08-03 22:58:10 +09:00
modpost.h modpost: refactor get_secindex() 2022-08-03 22:56:46 +09:00
sumversion.c modpost: use bool type where appropriate 2022-05-08 03:17:00 +09:00