bugGNU Development Chain for 68HC11/68HC12 - Bugs: bug #3331, Invalid group relaxation, bset...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #3331: Invalid group relaxation, bset uses an invalid address

Submitter:  Stephane Carrez <ciceron>
Submitted:  Fri 25 Apr 2003 07:49:59 PM UTC
   
 
Category:  binutils Severity:  4 - Important
Item Group:  sw-bug Status:  Fixed
Privacy:  Public Assigned to:  ciceron
Open/Closed:  Closed

Sun 27 Apr 2003 08:05:54 AM UTC, comment #2: 

Fixed in binutils 2.14 and release 2.2

Stephane Carrez <ciceron>
Group administrator
Fri 25 Apr 2003 07:53:42 PM UTC, comment #1: 


This is caused by the fact that there is a relocation
after the relocation marking the relax group, and this
second relocation is against a symbol in page0.  We incorrectly
think that this second relocation is for the relax group
and we activate the relax group optimization.  The result
is that the relax group is made against 'PuntAnalisiTasti'
instead of StatusByte.  The result is a 'bset' against
the 'PuntAnalisiTasti' symbol.

Stephane Carrez <ciceron>
Group administrator
Fri 25 Apr 2003 07:49:59 PM UTC, original submission:  

In the following program:

void (*PuntAnalisiTasti)() _attribute_ ((section (".page0")));
unsigned char StatusByte;

int _attribute_((noreturn)) main ();
void AnalisiTastiRestore (void);
void AnalisiTasti (void);

void _start (void)
{
    _asm_ __volatile__ ("lds #0x7fff");
    main();
}
int main ()
{
     while (1)
    {
    }
}


void AnalisiTasti (void)
{
    StatusByte |= 0x01;
    PuntAnalisiTasti = AnalisiTastiRestore;
}

void AnalisiTastiRestore (void)
{
}

when it is compiled with -mrelax, the 'bset' generated
in AnalisiTasti is using an invalid address (0) and it
does not use the original 'ldx #StatusByte'.  It is wrong
because StatusByte is not in page0.

Stephane Carrez <ciceron>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-04-27 ciceron Open/ClosedOpen None
2003-04-27 ciceron StatusNone None

Back to the top

Powered by Savane 3.13-3230.
Corresponding source code