coreboot-kgpe-d16/util/cbfstool
Julius Werner 84446e6e54 rmodtool: Make memlayout symbols absolute and do not relocate them
Memlayout is a mechanism to define memory areas outside the normal
program segment constructed by the linker. Therefore, it generally
doesn't make sense to relocate memlayout symbols when the program is
relocated. They tend to refer to things that are always in one specific
spot, independent of where the program is loaded.

This hasn't really hurt us in the past because the use case we have for
rmodules (ramstage on x86) just happens to not really need to refer to
any memlayout-defined areas at the moment. But that use case may come up
in the future so it's still worth fixing.

This patch declares all memlayout-defined symbols as ABSOLUTE() in the
linker, which is then reflected in the symbol table of the generated
ELF. We can then use that distinction to have rmodtool skip them when
generating the relocation table for an rmodule. (Also rearrange rmodtool
a little to make the primary string table more easily accessible to the
rest of the code, so we can refer to symbol names in debug output.)

A similar problem can come up with userspace unit tests, but we cannot
modify the userspace relocation toolchain (and for unfortunate
historical reasons, it tries to relocate even absolute symbols). We'll
just disable PIC and make those binaries fully static to avoid that
issue.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ic51d9add3dc463495282b365c1b6d4a9bf11dbf2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50629
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2021-02-18 02:32:06 +00:00
..
console treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
flashmap util: Use SPDX headers 2020-05-11 19:38:40 +00:00
lz4 lz4: Fix out-of-bounds reads 2020-03-02 15:03:03 +00:00
lzma util/cbfstool/lzma: Make clang-11+'s indentation checker happy 2020-02-01 19:51:31 +00:00
.gitignore util/cbfstool/.gitignore: Add ifittool 2020-12-07 14:02:38 +00:00
EXAMPLE
Makefile
Makefile.inc cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
ProcessorBind.h
amdcompress.c util/cbfstool/amdcompress: fix argument requirement 2020-11-15 16:49:30 +00:00
cbfs-mkpayload.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfs-mkstage.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfs-payload-linux.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfs.h cbfs: Add verification for RO CBFS metadata hash 2020-12-03 00:11:08 +00:00
cbfs_image.c util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS 2020-12-08 18:57:35 +00:00
cbfs_image.h cbfstool: Hide hash printing behind -v and add to parseable output 2020-12-03 00:08:03 +00:00
cbfs_sections.c
cbfs_sections.h
cbfscomptool.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
cbfstool.c util/cbfstool: Fix build in 32-bit userspace 2021-02-14 20:59:37 +00:00
coff.h
common.c
common.h util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS 2020-12-08 18:57:35 +00:00
compress.c cbfstool: Use cbfs_serialized.h and standard vboot helpers 2020-12-03 00:00:33 +00:00
default-x86.fmd drivers/vpd: Add VPD region to default FMAP when selected 2021-01-04 23:12:35 +00:00
default.fmd
description.md
elf.h
elfheaders.c
elfparsing.h
fdt.h
fit.c util/cbfstool/fit.c: Add support for adding Boot Guard manifests 2020-12-11 07:33:51 +00:00
fit.h
flashmap_tests.c
fmap_from_fmd.c
fmap_from_fmd.h
fmaptool.c util/cbfstool/fmaptool: Generate list of terminal sections 2020-12-08 18:59:05 +00:00
fmd.c
fmd.h
fmd_parser.c_shipped
fmd_parser.h_shipped
fmd_parser.y
fmd_scanner.c_shipped treewide: Remove trailing whitespace 2021-02-17 17:30:05 +00:00
fmd_scanner.h_shipped treewide: Remove trailing whitespace 2021-02-17 17:30:05 +00:00
fmd_scanner.l
fv.h
ifittool.c
ifwitool.c
linux.h
linux_trampoline.S
linux_trampoline.c
linux_trampoline.h
option.h
partitioned_file.c util/cbfstool: unbreak compilation on FreeBSD 2021-01-13 12:07:17 +00:00
partitioned_file.h
rmodtool.c
rmodule.c rmodtool: Make memlayout symbols absolute and do not relocate them 2021-02-18 02:32:06 +00:00
rmodule.h rmodtool: Make memlayout symbols absolute and do not relocate them 2021-02-18 02:32:06 +00:00
swab.h
xdr.c