[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/21676] New: Gold doesn't support INSERT in linker script
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/21676] New: Gold doesn't support INSERT in linker script |
Date: |
Mon, 26 Jun 2017 18:36:23 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=21676
Bug ID: 21676
Summary: Gold doesn't support INSERT in linker script
Product: binutils
Version: 2.29 (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: ---
'INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
This command is typically used in a script specified by '-T' to
augment the default 'SECTIONS' with, for example, overlays. It
inserts all prior linker script statements after (or before)
OUTPUT_SECTION, and also causes '-T' to not override the default
linker script. The exact insertion point is as for orphan
sections. *Note Location Counter::. The insertion happens after
the linker has mapped input sections to output sections. Prior to
the insertion, since '-T' scripts are parsed before the default
linker script, statements in the '-T' script occur before the
default linker script statements in the internal linker
representation of the script. In particular, input section
assignments will be made to '-T' output sections before those in
the default script. Here is an example of how a '-T' script using
'INSERT' might look:
SECTIONS
{
OVERLAY :
{
.ov1 { ov1*(.text) }
.ov2 { ov2*(.text) }
}
}
INSERT AFTER .text;
address@hidden gold]$ cat x.s
.text
.globl foo
foo:
.dc.a xxx
.section .bar,"a",%progbits
.globl bar
bar:
.dc.a xxx
address@hidden gold]$ cat x.t
SECTIONS
{
.bar : { *(.bar) }
}
INSERT AFTER .rela.dyn;
address@hidden gold]$ gcc -c x.s
address@hidden gold]$ ld -shared -T x.t x.o
address@hidden gold]$ readelf -SW a.out
There are 12 section headers, starting at offset 0x1238:
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .hash HASH 0000000000000120 000120 000030 04 A
2 0 8
[ 2] .dynsym DYNSYM 0000000000000150 000150 0000a8 18 A
3 1 8
[ 3] .dynstr STRTAB 00000000000001f8 0001f8 000025 00 A
0 0 1
[ 4] .rela.dyn RELA 0000000000000220 000220 000030 18 A
2 0 8
[ 5] .bar PROGBITS 0000000000000250 000250 000008 00 A
0 0 1
[ 6] .text PROGBITS 0000000000000258 000258 000008 00 AX
0 0 1
[ 7] .eh_frame PROGBITS 0000000000000260 000260 000000 00 A
0 0 8
[ 8] .dynamic DYNAMIC 0000000000200f10 000f10 0000f0 10 WA
3 0 8
[ 9] .symtab SYMTAB 0000000000000000 001000 000198 18
10 11 8
[10] .strtab STRTAB 0000000000000000 001198 000044 00
0 0 1
[11] .shstrtab STRTAB 0000000000000000 0011dc 000059 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)
address@hidden gold]$
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/21676] New: Gold doesn't support INSERT in linker script,
hjl.tools at gmail dot com <=