[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/24491] New: -z noseparate-code generates segment with both rodat
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/24491] New: -z noseparate-code generates segment with both rodata and text |
Date: |
Sat, 27 Apr 2019 03:11:51 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24491
Bug ID: 24491
Summary: -z noseparate-code generates segment with both rodata
and text
Product: binutils
Version: 2.33 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
address@hidden xxx]$ cat minpage1.s
.globl main
.globl start
.globl _start
.globl __start
.text
main:
start:
_start:
__start:
.space 0x10000000
.section .rodata,"a",%progbits
.space 0x1000
.data
.long 0
address@hidden xxx]$ cat minpage3.t
SECTIONS
{
. = SIZEOF_HEADERS;
.rodata : {*(.rodata)}
.text : {*(.text)}
. = ALIGN(CONSTANT (MAXPAGESIZE));
.data : {*(.data)}
/DISCARD/ : {*(*)}
}
address@hidden xxx]$ make
as -mx86-used-note=no -o minpage1.o minpage1.s
./ld -z noseparate-code -z norelro -T minpage3.t -o x minpage1.o
readelf -SlW x
There are 7 section headers, starting at offset 0x10002108:
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .rodata PROGBITS 00000000000000b0 0000b0 001000 00 A
0 0 1
[ 2] .text PROGBITS 00000000000010b0 0010b0 10000000 00
AX 0 0 1
[ 3] .data PROGBITS 0000000010002000 10002000 000004 00
WA 0 0 1
[ 4] .symtab SYMTAB 0000000000000000 10002008 0000c0 18
5 4 8
[ 5] .strtab STRTAB 0000000000000000 100020c8 00000e 00
0 0 1
[ 6] .shstrtab STRTAB 0000000000000000 100020d6 00002f 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),
l (large), p (processor specific)
Elf file type is EXEC (Executable file)
Entry point 0x10b0
There are 2 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x100010b0
0x100010b0 R E 0x1000
LOAD 0x10002000 0x0000000010002000 0x0000000010002000 0x000004
0x000004 RW 0x1000
Section to Segment mapping:
Segment Sections...
00 .rodata .text <<<< This segment has both text and rodata.
01 .data
address@hidden xxx]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/24491] New: -z noseparate-code generates segment with both rodata and text,
hjl.tools at gmail dot com <=