[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [RFC] [bug #9348] asin (acos) & atan problem (64K bou
From: |
Theodore A. Roth |
Subject: |
Re: [avr-libc-dev] [RFC] [bug #9348] asin (acos) & atan problem (64K boundary) |
Date: |
Mon, 1 Nov 2004 09:16:13 -0800 (PST) |
On Thu, 28 Oct 2004, Joerg Wunsch wrote:
> As Theodore A. Roth wrote:
>
> > It seems to me that moving the tables into a .c file would allow us to
> > have gcc force the table in the lower 64K. For example, the table_asin
> > defined as such in asin.S:
>
> ...
>
> > would be moved to table_asin.c like this
> >
> > #include <avr/pgmspace.h>
> > #include <avr/stdint.h>
> >
> > uint8_t table_asin [] PROGMEM = {
>
> I basically like the idea, and think it'll solve the problem.
>
> Though, I wouldn't opt for a separate C source file, but rather for
> the appropriate section attributes applied just for the table, so the
> linker will sort it appropriately even though coming from an assembler
> source file.
>
> If I'm not mistaken, this should be:
>
> .section .progmem.data,"a",@progbits
That was my first thought, but I didn't know that it was possible and
didn't look into it.
The fix is actually very trivial. The asin.S and atan.S files were just
missing PGM_SECTION before the tables.
I double checked all the other files with lookup tables and they all
seem to do the right thing and have PGM_SECTION before the tables.
I've committed the attached patch to both HEAD and 1.0.
---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden
avr-libc-1.0-bug-9348.diff
Description: Text document