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

--- Comment #1 from Cary Coutant <ccoutant at gmail dot com> ---
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.

(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?)

-- 
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

Reply via email to