[PATCH] ld.hugetlbfs: fix -Ttext-segment argument on AArch64

14 views
Skip to first unread message

Steve Capper

unread,
Jan 6, 2020, 11:26:05 AM1/6/20
to libhug...@googlegroups.com, Nick Gasson, Steve Capper
From: Nick Gasson <nick....@arm.com>

The argument to -Ttext-segment should be a hex value but we are passing
the huge page size in decimal. This generates a "address of
`text-segment' isn't multiple of maximum page size" warning from ld.

Signed-off-by: Nick Gasson <nick....@arm.com>
Reviewed-by: Steve Capper <steve....@arm.com>
Signed-off-by: Steve Capper <steve....@arm.com>
---
ld.hugetlbfs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ld.hugetlbfs b/ld.hugetlbfs
index 6ee8238..5e4e497 100755
--- a/ld.hugetlbfs
+++ b/ld.hugetlbfs
@@ -130,7 +130,9 @@ if [ "$HTLB_ALIGN" == "slice" ]; then
# targeting the ARM platform one needs to explicitly set the text segment offset
# otherwise it will be NULL.
case "$EMU" in
- armelf*_linux_eabi|aarch64elf*|aarch64linux*) HTLBOPTS="$HTLBOPTS -Ttext-segment=$SLICE_SIZE" ;;
+ armelf*_linux_eabi|aarch64elf*|aarch64linux*)
+ printf -v TEXTADDR "%x" "$SLICE_SIZE"
+ HTLBOPTS="$HTLBOPTS -Ttext-segment=$TEXTADDR" ;;
elf_i386) HTLBOPTS="$HTLBOPTS -Ttext-segment=0x08000000" ;;
elf64ppc|elf64lppc)
if [ "$MMU_TYPE" == "Hash" ] ; then
--
2.20.1

Eric B Munson

unread,
Feb 26, 2020, 9:36:52 AM2/26/20
to Steve Capper, libhug...@googlegroups.com, Nick Gasson
On Mon, 06 Jan 2020, Steve Capper wrote:

> From: Nick Gasson <nick....@arm.com>
>
> The argument to -Ttext-segment should be a hex value but we are passing
> the huge page size in decimal. This generates a "address of
> `text-segment' isn't multiple of maximum page size" warning from ld.
>
> Signed-off-by: Nick Gasson <nick....@arm.com>
> Reviewed-by: Steve Capper <steve....@arm.com>
> Signed-off-by: Steve Capper <steve....@arm.com>

Applied, Thanks
Eric
Reply all
Reply to author
Forward
0 new messages