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: how to link a section in specific .o inside .a via linker script?


Hi Mat,

Once I have this properly tested I can submit a patch, but I don't
know if anyone else actually wants this feature.

Well I am sure that there will be people interested in seeing the patch, even if it does not get included into the sources. Remember though, that in order for us to consider a patch you would need to have signed a FSF copyright assignment for it. If you just want to tell people about it, but not submit it, then maybe posting a URL to it would be a better idea.


In the long run however you may find that modifying your tool so that it automatically extracts the required object files from the libraries would be a better solution. This way it will then work with any version of the GNU linker, not just your patched version(*).

Admittedly there are messy issues I did not address or think about, like SORT(MEMBER(...)),
etc.

Mmm, yes. These would need to be addressed before the patch could be accepted.


P.S. I also needed to change the link map generator to write out the required
     alignment of each section alongside its address and size information.
     I wrote it out as a comment to try to be compatible with any tools
     parsing linker maps, but that's kinda gross. I wonder if anyone
     else wants the alignment information in a convenient way.

I think that this would be a useful addition to the -Map output. (It might also help spot cases where section alignment is not being handled correctly). For compatibility sakes though, maybe a variant of the -Map switch should be used instead. eg:


-Map-with-alignments <FILE>

Cheers
  Nick

(*) Modulo the -Map option emitting the section alignment requirements of course.



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