This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Aligning .text segments


> Also - this script is just a fragment - a full script would also need to
> specify the locations of other sections like .data, .bss and so on. Your
> best bet is to take the linker's builtin default script (shown when you run
> "gold --verbose") and modify that to suit your needs.

Gold doesn't use a default linker script, so gold --verbose won't
help. In gold, linker scripts are really meant for full-on embedded
applications where you really want full control over the placement of
everything, and you're responsible for making sure the script handles
all the various input sections that the linker might see. It's
possible that you could print BFD ld's default linker script and use
that with gold, but it seems like an extremely heavy-weight solution.

To set the alignment for individual functions, I think you'd be better
off using __attribute__ ((aligned (n))) in the source code.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]