History log of /u-boot/tools/prelink-riscv.inc
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# fb3cc482 13-Apr-2023 Bin Meng <bmeng@tinylab.org>

tools: prelink-riscv: Cosmetic style fixes

Some coding convention fixes.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>

# 71bdfcb2 11-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Handle addend to absolute reloc in prelink-riscv

Previously the handling of R_RISCV_32 and R_RISCV_64 would simply
insert the value of the symbol and ignore any addend. However, there
exist relocs where the addend is non-zero:

0000000080250900 R_RISCV_64 efi_runtime_services+0x0000000000000068
0000000080250910 R_RISCV_64 efi_runtime_services+0x0000000000000038
0000000080250920 R_RISCV_64 efi_runtime_services+0x0000000000000018
0000000080250930 R_RISCV_64 efi_runtime_services+0x0000000000000020
0000000080250980 R_RISCV_64 efi_runtime_services+0x0000000000000048
0000000080250990 R_RISCV_64 efi_runtime_services+0x0000000000000050
00000000802509a0 R_RISCV_64 efi_runtime_services+0x0000000000000058
0000000080250940 R_RISCV_64 systab+0x0000000000000030
0000000080250950 R_RISCV_64 systab+0x0000000000000040
0000000080250960 R_RISCV_64 systab+0x0000000000000050
0000000080250970 R_RISCV_64 systab+0x0000000000000060

In these cases the addend needs to be added to the symbol value to get
the correct value for the reloc.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>

# 4539926a 02-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Add big endian target support to prelink-riscv

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>

# e604410d 02-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Fix prelink-riscv to work on big endian hosts

All ELF fields whose values are inspected by the code are converted to
CPU byteorder first. Values which are copied verbatim (relocation
fixups) are not swapped to CPU byteorder and back as it is not needed.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 42ac26f2 25-Dec-2017 Rick Chen <rick@andestech.com>

riscv: tools: Prelink u-boot

Add prelink-riscv to arrange .rela.dyn and .rela.got
in compile time. So that u-boot can be directly
executed without fixup.

Signed-off-by: Chih-Mao Chen <cmchen@andestech.com>
Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Signed-off-by: Greentime Hu <green.hu@gmail.com>

# 71bdfcb2 11-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Handle addend to absolute reloc in prelink-riscv

Previously the handling of R_RISCV_32 and R_RISCV_64 would simply
insert the value of the symbol and ignore any addend. However, there
exist relocs where the addend is non-zero:

0000000080250900 R_RISCV_64 efi_runtime_services+0x0000000000000068
0000000080250910 R_RISCV_64 efi_runtime_services+0x0000000000000038
0000000080250920 R_RISCV_64 efi_runtime_services+0x0000000000000018
0000000080250930 R_RISCV_64 efi_runtime_services+0x0000000000000020
0000000080250980 R_RISCV_64 efi_runtime_services+0x0000000000000048
0000000080250990 R_RISCV_64 efi_runtime_services+0x0000000000000050
00000000802509a0 R_RISCV_64 efi_runtime_services+0x0000000000000058
0000000080250940 R_RISCV_64 systab+0x0000000000000030
0000000080250950 R_RISCV_64 systab+0x0000000000000040
0000000080250960 R_RISCV_64 systab+0x0000000000000050
0000000080250970 R_RISCV_64 systab+0x0000000000000060

In these cases the addend needs to be added to the symbol value to get
the correct value for the reloc.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>

# 4539926a 02-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Add big endian target support to prelink-riscv

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>

# e604410d 02-Aug-2019 Marcus Comstedt <marcus@mc.pp.se>

riscv: tools: Fix prelink-riscv to work on big endian hosts

All ELF fields whose values are inspected by the code are converted to
CPU byteorder first. Values which are copied verbatim (relocation
fixups) are not swapped to CPU byteorder and back as it is not needed.

Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 42ac26f2 25-Dec-2017 Rick Chen <rick@andestech.com>

riscv: tools: Prelink u-boot

Add prelink-riscv to arrange .rela.dyn and .rela.got
in compile time. So that u-boot can be directly
executed without fixup.

Signed-off-by: Chih-Mao Chen <cmchen@andestech.com>
Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Signed-off-by: Greentime Hu <green.hu@gmail.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# 42ac26f2 25-Dec-2017 Rick Chen <rick@andestech.com>

riscv: tools: Prelink u-boot

Add prelink-riscv to arrange .rela.dyn and .rela.got
in compile time. So that u-boot can be directly
executed without fixup.

Signed-off-by: Chih-Mao Chen <cmchen@andestech.com>
Signed-off-by: Rick Chen <rick@andestech.com>
Signed-off-by: Rick Chen <rickchen36@gmail.com>
Signed-off-by: Greentime Hu <green.hu@gmail.com>