This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Patch to "generalize" setting section start addresses via command line


Hi Thomas,

: We needed a simple way to set start adresses of other sections
: from the command line, but, we also use -T for external linker
: scripts so wanted to preserve all the present ld behavior. We
: ended up adding a new command line option:
: 
: --section-start sectionname=org
: 
: sectionname can be any section instead of just .text/.data/.bss
: and you must include all the characters (.) in your section
: names... (the syntax is like that of -defsym)

  Whilst I agree with this idea in principle, I have reservations
about the implementation.  Specifically I do not like the way it uses
yyparse() to implement the semantics of the new switch.

  The reason that the --defsym switch does this is because the linker
script grammar also supports defining a symbol using the same syntax
as the switch.  This is not true of your new switch however, (the
grammar does have a syntax for defining a section's start address, but
it is quite different from the proposed syntax for your new switch),
and so I think it is inappropriate to use yacc to perform this job.

  I think it should be relatively easy for you to change your patch so
that the code in parse_args() actually parses the entirety of your new
switch and then calls lang_section_start() directly.  If you would
like to do that and then resubmit the patch I will be happy to review
it again.

Cheers
	Nick

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