Re: [cc65] String Literal Segment in C code

From: Agent Friday <64subnet1gmail.com>
Date: 2010-12-05 00:04:35
On Thu, Dec 2, 2010 at 11:33 PM, Greg King <greg.king4@verizon.net> wrote:
> From: "Agent Friday"; on Thurs., Dec. 02, 2010; at 09:19 PM -0500
> > > On Thu, Dec 2, 2010 at 8:18 AM, Greg King wrote:
> > > The reason for that need is that strings aren't put into the output
> > > until the entire source file has been compiled. Then, all of the
> > > strings are merged and dumped, as a block. In your example, you had
> > > _two_ #pragma rodataseg() lines; cc65 used the last one!
> >
> > Wow!  So, rodataseg is a module-wide setting.  Good to know.
> >
> > Almost seems like the second use of that pragma within a module
> > should generate a warning, since it's not likely doing what the
> > author intended.
> >
> Only strings work that way!  Other const data is put into the output,
> as soon as it is seen.  So, multiple pragmas can be useful.  Also, Uz
> recently added a "#pragma local-strings()" to cc65.  It can generate
> strings in the same immediate way that other const data is handled.  I
> didn't mention it because modularity is a much more useful method, in
> Joseph's case.

Yeah, I like that pragma.  If he does use it, there's no reason that
the strings from all modules couldn't still go into the same rodata
segment, right?  This would then allow switching the rodata segment
within a module, to separate string constants from other constant
types.

It seems that the case of creating a string table is just not
handled very well by cc65.  It would be really nice if you could
specify an rodata segment to be used for strings but not for other
data types.

// Agent Friday
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Dec 5 00:04:40 2010

This archive was generated by hypermail 2.1.8 : 2010-12-05 00:04:43 CET