https://sourceware.org/bugzilla/show_bug.cgi?id=21252
Bug ID: 21252 Summary: -shared/-pie create RWE LOAD segment Product: binutils Version: 2.29 (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: hppa64-linux hjl@gnu-mic-2 ld]$ cat x.s .text .global start /* Used by SH targets. */ start: .global _start _start: .global __start __start: .global main /* Used by HPPA targets. */ main: .dc.a 0 .data .byte 2 [hjl@gnu-mic-2 ld]$ ../gas/as-new -o x.o x.s [hjl@gnu-mic-2 ld]$ ./ld-new -shared x.o [hjl@gnu-mic-2 ld]$ ../binutils/readelf -SWl a.out There are 10 section headers, starting at offset 0x14e8: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [ 0] NULL 0000000000000000 000000 000000 00 0 0 0 [ 1] .dynamic DYNAMIC 00000000000000e8 0000e8 0000e0 10 WA 4 0 8 [ 2] .hash HASH 00000000000001c8 0001c8 000034 04 A 3 0 8 [ 3] .dynsym DYNSYM 0000000000000200 000200 0000c0 18 A 4 1 8 [ 4] .dynstr STRTAB 00000000000002c0 0002c0 000026 00 A 0 0 1 [ 5] .text PROGBITS 00000000000002e8 0002e8 000008 00 AX 0 0 8 [ 6] .data PROGBITS 00000000000012f0 0012f0 000011 00 WA 0 0 1 [ 7] .symtab SYMTAB 0000000000000000 001308 000168 18 8 8 8 [ 8] .strtab STRTAB 0000000000000000 001470 00002f 00 0 0 1 [ 9] .shstrtab STRTAB 0000000000000000 00149f 000046 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), p (processor specific) Elf file type is DYN (Shared object file) Entry point 0x2e8 There are 3 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000000000040 0x0000000000000000 0x0000a8 0x0000a8 R E 0x8 LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x001301 0x001301 RWE 0x1000 DYNAMIC 0x0000e8 0x00000000000000e8 0x00000000000000e8 0x0000e0 0x0000e0 RW 0x8 Section to Segment mapping: Segment Sections... 00 01 .dynamic .hash .dynsym .dynstr .text .data 02 .dynamic [hjl@gnu-mic-2 ld]$ I was expecting LOAD 0x000000 0x0000000000010000 0x0000000000010000 0x0000f0 0x0000f0 R E 0x1000 LOAD 0x0000f0 0x00000000000110f0 0x00000000000110f0 0x000011 0x000011 RW 0x1000 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils