<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Absolute positioning unexplain behavior</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38244/absolute-positioning-unexplain-behavior</link><description> 
Hello, 
I am working with the Realview linker. The source of the issue is
likely to be documented but I cannot find it - maybe you can help
me. 
when I&amp;#39;m using the following scatter file: 

 
 ER_IROM1 0x28000 0x56000 { ; load address = execution address</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/114711?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 05:27:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4969ea87-2dd5-4a06-9b3a-bcea00911dbc</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Found it. This scatter file seems to handle it better:&lt;/p&gt;

&lt;pre&gt;
LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x1000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x29000 FIXED 0x60 {    ; this region is used to export the software event function for quick invocation
                                                                                ; by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
  ER_IROM2 0x29060 0X54FA0  {  ; load address = execution address
   .ANY (+RO)
  }

I&amp;#39;m still not sure why...the only difference is that the section SOFTWARE_EVENT is now located before the absolutely positioned stuff.
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/101665?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 05:11:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:01c2bdfa-968e-4302-94a4-42eb3e7d226e</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
of course I can force the linker by doing something like
this:&lt;/p&gt;

&lt;pre&gt;
LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x8000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  ER_IROM3 0x30000 0x8000  {  ; load address = execution address
        &lt;b&gt;SYSTEM_TIMER.o&lt;/b&gt;
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x38000 FIXED 0x60 {    ; this region is used to export the software event function for quick invocation
                                                                                ; by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
  ER_IROM2 0x38060 FIXED  {  ; load address = execution address
   .ANY (+RO)
  }

&lt;/pre&gt;

&lt;p&gt;
But I has hoped that the linker would clever enough (or me less
dumb :-) )&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/89590?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 04:49:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d39a1d3f-7ea4-4cd4-bf61-f9217fec293d</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Marcus,&lt;br /&gt;
Can you/anybody explain the following phenomenon?&lt;br /&gt;
This scatter file&lt;/p&gt;

&lt;pre&gt;
LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x10000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x38000 FIXED 0x60 {    ; this region is used to export the software event function for quick invocation
                                                                                ; by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
  ER_IROM2 0x38060 FIXED  {  ; load address = execution address
   .ANY (+RO)
  }
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
Creates a huge hole in my flash:&lt;/p&gt;

&lt;pre&gt;
    RESET                                    0x00028000   Section      380  lpc2400.o(RESET)
    Undef_Handler                            0x00028040   ARM Code       4  lpc2400.o(RESET)
    PAbt_Handler                             0x00028044   ARM Code       4  lpc2400.o(RESET)
    DAbt_Handler                             0x00028048   ARM Code       4  lpc2400.o(RESET)
    IRQ_Handler                              0x0002804c   ARM Code       4  lpc2400.o(RESET)
    FIQ_Handler                              0x00028050   ARM Code       4  lpc2400.o(RESET)
    !!!main                                  0x0002817c   Section        8  __main.o(!!!main)
    !!!scatter                               0x00028184   Section       60  __scatter.o(!!!scatter)
    !!dczerorl                               0x000281c0   Section       68  __dczerorl.o(!!dczerorl)
    !!handler_zi                             &lt;b&gt;0x00028204   Section       44  __scatter_zi.o(!!handler_zi)
    .ARM.__AT_0x00030010                     0x00030010   Section       16  sys_version.o(.ARM.__AT_0x00030010)
    .ARM.__AT_0x00030020                     &lt;/b&gt;0x00030020   Section       16  sys_version.o(.ARM.__AT_0x00030020)
    .ARM.__AT_0x00030030                     0x00030030   Section       16  sys_version.o(.ARM.__AT_0x00030030)
&lt;b&gt;    .ARM.__AT_0x00030040                     0x00030040   Section       16  sys_version.o(.ARM.__AT_0x00030040)
    .ARM.__AT_0x00037FF0                     0x00037ff0   Section       16  sys_version.o(.ARM.__AT_0x00037FF0)
&lt;/b&gt;
&lt;/pre&gt;

&lt;p&gt;
Why aren&amp;#39;t the regions 0x28204 to 0x30010 and 0x30040 to 0x37FF0
used?&lt;br /&gt;
How can I coax the linker to fill there regions?&lt;br /&gt;
sys_version.o contains variables that are absolutely located.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/89585?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 04:01:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:63563426-7bef-494b-baa8-0e298b7caa0f</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
this seems to work:&lt;/p&gt;

&lt;pre&gt;
LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x10000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x38000 FIXED 0x140 {   ; this region is used to export the software event function for quick invocation
                                                                                ; by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
  ER_IROM2 0x38140 FIXED  {  ; load address = execution address
   .ANY (+RO)
  }

&lt;/pre&gt;

&lt;p&gt;
the bootloader updates the last 16 bytes starting at 0x37FF0 when
program update succeeds. I still wonder why the previous attempt went
wrong!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/89591?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 03:01:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e5b1d2ac-32f4-4c77-a8f8-79248c9074cc</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
Marcus,&lt;/p&gt;

&lt;p&gt;
Sorry for the confusion.&lt;br /&gt;
It should have been&lt;/p&gt;

&lt;pre&gt;
ER_IROM1 0x28000 0xD000  {  ; load address = execution address

&lt;/pre&gt;

&lt;p&gt;
(I did not undo enough).&lt;br /&gt;
I found that if I position my code at the end of the flash (maybe the
fact that it is after the key matters?), it works:&lt;/p&gt;

&lt;pre&gt;
LR_IROM1 0x28000 0x56000  {    ; load region size_region
  ER_IROM1 0x28000 0x55C00  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  SOFTWARE_EVENT 0x6DC00 FIXED 0x140 {   ; this region is used to export the software event function for quick invocation
                                                         ; by the firmware in case of a failure
        SOFTWARE_EVENT.o (+RO)
  }
&lt;/pre&gt;

&lt;p&gt;
but this increases my flash time...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/55507?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 02:43:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:71775907-ee1e-4400-9dc8-d5a2599103de</guid><dc:creator>Marcus Harnisch</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tamir&lt;/p&gt;

&lt;p&gt;
The regions SOFTWARE_EVENT and ER_IROM2 share addresses with
ER_IROM1. This might confuse the linker. Are you not getting any
warnings?&lt;/p&gt;

&lt;p&gt;
Regards&lt;br /&gt;
Marcus&lt;br /&gt;
&lt;a href="http://www.doulos.com/arm/"&gt;http://www.doulos.com/arm/&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Absolute positioning unexplain behavior</title><link>https://community.arm.com/thread/55506?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2009 02:36:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f6fd52bc-e21c-4a16-8f01-659942f1adab</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
oops:&lt;br /&gt;
I meant to say: &amp;quot;the map file shows the right address for the key,
but looking at the generated binary reveals the problem.&amp;quot;&lt;/p&gt;

&lt;p&gt;
and the required offset is actually 0xFFF0.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>