[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/27039] New: Gold doesn't support SHF_GNU_RETAIN
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/27039] New: Gold doesn't support SHF_GNU_RETAIN |
Date: |
Wed, 09 Dec 2020 13:11:24 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=27039
Bug ID: 27039
Summary: Gold doesn't support SHF_GNU_RETAIN
Product: binutils
Version: 2.36 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: hjl.tools at gmail dot com
CC: ian at airs dot com
Target Milestone: ---
[hjl@gnu-cfl-2 gold-1]$ cat x.s
.global discard0
.section .bss.discard0,"aw"
.type discard0, %object
discard0:
.zero 2
.global discard1
.section .bss.discard1,"aw"
.type discard1, %object
discard1:
.zero 2
.global discard2
.section .data.discard2,"aw"
.type discard2, %object
discard2:
.word 1
.section .bss.sdiscard0,"aw"
.type sdiscard0, %object
sdiscard0:
.zero 2
.section .bss.sdiscard1,"aw"
.type sdiscard1, %object
sdiscard1:
.zero 2
.section .data.sdiscard2,"aw"
.type sdiscard2, %object
sdiscard2:
.word 1
.section .text.fndiscard0,"ax"
.global fndiscard0
.type fndiscard0, %function
fndiscard0:
.word 0
.global retain0
.section .bss.retain0,"awR"
.type retain0, %object
retain0:
.zero 2
.global retain1
.section .bss.retain1,"awR"
.type retain1, %object
retain1:
.zero 2
.global retain2
.section .data.retain2,"awR"
.type retain2, %object
retain2:
.word 1
.section .bss.sretain0,"awR"
.type sretain0, %object
sretain0:
.zero 2
.section .bss.sretain1,"awR"
.type sretain1, %object
sretain1:
.zero 2
.section .data.sretain2,"aRw"
.type sretain2, %object
sretain2:
.word 1
.section .text.fnretain1,"Rax"
.global fnretain1
.type fnretain1, %function
fnretain1:
.word 0
.section .text.fndiscard2,"ax"
.global fndiscard2
.type fndiscard2, %function
fndiscard2:
.word 0
.section .bss.lsretain0,"awR"
.type lsretain0.2, %object
lsretain0.2:
.zero 2
.section .bss.lsretain1,"aRw"
.type lsretain1.1, %object
lsretain1.1:
.zero 2
.section .data.lsretain2,"aRw"
.type lsretain2.0, %object
lsretain2.0:
.word 1
.section .text._start,"ax"
.global _start
.type _start, %function
_start:
.word 0
[hjl@gnu-cfl-2 gold-1]$ make x
as -o x.o x.s
./ld -e _start --gc-sections -o x x.o
[hjl@gnu-cfl-2 gold-1]$ nm x
0000000000000000 A __bss_start
0000000000000000 A _edata
0000000000000000 A _end
00000000004000d0 T _start
[hjl@gnu-cfl-2 gold-1]$ cat y.s
.section .preinit_array.01000,"aw",%preinit_array
.dc.a 0
.section .init_array.01000,"aw",%init_array
.dc.a 0
.section .fini_array.01000,"aw",%fini_array
.dc.a 0
.section .preinit_array.01000,"awR",%preinit_array
.dc.a 0
.section .init_array.01000,"awR",%init_array
.dc.a 0
.section .fini_array.01000,"awR",%fini_array
.dc.a 0
.text
.globl _start
_start:
.dc.a 0
[hjl@gnu-cfl-2 gold-1]$ make y
as -o y.o y.s
./ld -pie -e _start --gc-sections -o y y.o
[hjl@gnu-cfl-2 gold-1]$ readelf -d y
Dynamic section at offset 0xe60 contains 21 entries:
Tag Type Name/Value
0x0000000000000015 (DEBUG) 0x0
0x0000000000000006 (SYMTAB) 0x1f8
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000005 (STRTAB) 0x210
0x000000000000000a (STRSZ) 1 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x218
0x0000000000000004 (HASH) 0x238
0x0000000000000020 (PREINIT_ARRAY) 0x1e30
0x0000000000000021 (PREINIT_ARRAYSZ) 0x8
0x0000000000000019 (INIT_ARRAY) 0x1e38
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x1e40
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x0000000000000020 (PREINIT_ARRAY) 0x1e48
0x0000000000000021 (PREINIT_ARRAYSZ) 0x8
0x0000000000000019 (INIT_ARRAY) 0x1e50
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x1e58
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffffb (FLAGS_1) Flags: PIE
0x0000000000000000 (NULL) 0x0
[hjl@gnu-cfl-2 gold-1]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/27039] New: Gold doesn't support SHF_GNU_RETAIN,
hjl.tools at gmail dot com <=