https://sourceware.org/bugzilla/show_bug.cgi?id=34184
Bug ID: 34184
Summary: -z max-page-size=0x200000 doesn't work on riscv
Product: binutils
Version: 2.47 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
Target: riscv
[hjl@gnu-tgl-3 tmp]$ cat x.c
#include <stdio.h>
int
main ()
{
printf ("hello\n");
return 0;
}
[hjl@gnu-tgl-3 tmp]$
/export/build/gnu/tools-build/glibc-many/install/compilers/riscv64-linux-gnu-rv64imac-lp64/bin/riscv64-glibc-linux-gnu-gcc
-static x.c
[hjl@gnu-tgl-3 tmp]$ ./a.out
hello
[hjl@gnu-tgl-3 tmp]$ readelf -lW a.out
Elf file type is EXEC (Executable file)
Entry point 0x10380
There are 7 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
RISCV_ATTRIBUT 0x06b853 0x0000000000000000 0x0000000000000000 0x000054
0x000000 R 0x1
LOAD 0x000000 0x0000000000010000 0x0000000000010000 0x066640
0x066640 R E 0x1000
LOAD 0x066808 0x0000000000077808 0x0000000000077808 0x005030
0x00a4c8 RW 0x1000
NOTE 0x066620 0x0000000000076620 0x0000000000076620 0x000020
0x000020 R 0x4
TLS 0x066808 0x0000000000077808 0x0000000000077808 0x000038
0x000050 R 0x8
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000
0x000000 RW 0x10
GNU_RELRO 0x066808 0x0000000000077808 0x0000000000077808 0x0037f8
0x0037f8 R 0x1
Section to Segment mapping:
Segment Sections...
00 .riscv.attributes
01 .rela.plt .plt .text .rodata .eh_frame .gcc_except_table
.note.ABI-tag
02 .tdata .preinit_array .init_array .fini_array .data.rel.ro .got
.got.plt .data .sdata .bss
03 .note.ABI-tag
04 .tdata .tbss
05
06 .tdata .preinit_array .init_array .fini_array .data.rel.ro .got
[hjl@gnu-tgl-3 tmp]$
/export/build/gnu/tools-build/glibc-many/install/compilers/riscv64-linux-gnu-rv64imac-lp64/bin/riscv64-glibc-linux-gnu-gcc
-static -Wl,-z,max-page-size=0x200000 x.c
[hjl@gnu-tgl-3 tmp]$ ./a.out
qemu-riscv64-static: /tmp/a.out: Error mapping file: Operation not permitted
[hjl@gnu-tgl-3 tmp]$ readelf -lW a.out
Elf file type is EXEC (Executable file)
Entry point 0x10380
There are 7 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
RISCV_ATTRIBUT 0x201853 0x0000000000000000 0x0000000000000000 0x000054
0x000000 R 0x1
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x076640
0x076640 R E 0x200000
LOAD 0x1fc808 0x00000000003fc808 0x00000000003fc808 0x005030
0x00a4c8 RW 0x200000
NOTE 0x076620 0x0000000000076620 0x0000000000076620 0x000020
0x000020 R 0x4
TLS 0x1fc808 0x00000000003fc808 0x00000000003fc808 0x000038
0x000050 R 0x8
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000
0x000000 RW 0x10
GNU_RELRO 0x1fc808 0x00000000003fc808 0x00000000003fc808 0x0037f8
0x0037f8 R 0x1
Section to Segment mapping:
Segment Sections...
00 .riscv.attributes
01 .rela.plt .plt .text .rodata .eh_frame .gcc_except_table
.note.ABI-tag
02 .tdata .preinit_array .init_array .fini_array .data.rel.ro .got
.got.plt .data .sdata .bss
03 .note.ABI-tag
04 .tdata .tbss
05
06 .tdata .preinit_array .init_array .fini_array .data.rel.ro .got
[hjl@gnu-tgl-3 tmp]$
--
You are receiving this mail because:
You are on the CC list for the bug.