bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/18975] gold: code_fill not executed if linker script is in use


From: koriakin at 0x04 dot net
Subject: [Bug gold/18975] gold: code_fill not executed if linker script is in use
Date: Wed, 16 Sep 2015 22:25:09 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18975

--- Comment #2 from Marcin Koƛcielnicki <koriakin at 0x04 dot net> ---
(In reply to Cary Coutant from comment #1)
> The way to fill holes in a section when using scripts is to specify a fill
> pattern; e.g.:
> 
> SECTIONS {
>         .text : { *(.text) } = 0x90909090
> }
> 
> or
> 
> SECTIONS {
>         .text : { FILL(0x90909090) *(.text) }
> }
> 
> Interestingly, when using the latter, Gnu ld doesn't use the fill pattern,
> but instead fills with a span-dependent NOP, as if no fill pattern had been
> specified.
> 
> (Note: while Gnu ld supports fill patterns of arbitrary length, gold
> currently supports only 4-byte fill patterns. There's a FIXME in the code,
> but I don't think there's been a PR filed for that.)
> 
> Nothing in the ld manual says that a code section should be filled with NOPs
> in the absence of a FILL pattern.

Well, if it's not supposed to use implicit fill pattern when scripts are in
use, then the testsuite is buggy by not mentioning the correct fill pattern for
.init/.fini sections. And that's not exactly easy to do if it has to support
all the gold architectures. Is there some way to explicitely request standard
code fill in a script?

> (Aside: If I remember the s360 instruction set well enough, instructions can
> be 2, 4, or 6 bytes long. Setting an alignment of 4 on a code section seems
> like a bad idea to begin with. Besides that, .init and .fini sections have
> been obsolete for, what, 17 years now?)

It's no worse than the 16-byte alignment in use on x86, I suppose. And
.init/.fini may be obsolete, but are still in use and causing trouble...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]