<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Linker / Compilier Auto aligh uint_32's? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179978#M2618</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes sense, thanks JuroV!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2011 06:15:50 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2011-02-01T06:15:50Z</dc:date>
    <item>
      <title>Linker / Compilier Auto aligh uint_32's?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179974#M2614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MQX3.6.2 + CW7.2+MCF52259evb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following C file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;in envm.c#include &amp;lt;ctype.h&amp;gt;#include &amp;lt;mqx.h&amp;gt;#include &amp;lt;bsp.h&amp;gt;#include "envm.h"#pragma explicit_zero_data on#pragma force_active onvolatile uint_32 TEST1 = 1;         //This is a specific random number defined in the headervolatile uchar TEST2 = 0;volatile uint_32 TEST3 = 2;         //This is a specific random number defined in the headervolatile uchar TEST4 = 4;        //Compile Time#pragma explicit_zero_data off#pragma force_active off&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;In my linker, I added the following twoENVM_DATA   (RW): ORIGIN = 0x10050000, LENGTH = 0x00001000  # MRAM space for some dataand .ENVM_DATA_Page: {  envm.c (.data)  envm.c (.rodata)  envm.c (.text) } &amp;gt; ENVM_DATA&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In xMAP output I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# .ENVM_DATA_Page&lt;BR /&gt;&amp;nbsp; 10050000 00000004 .data&amp;nbsp;&amp;nbsp; TEST1&amp;nbsp;&amp;nbsp; &amp;nbsp;(envm.c)&lt;BR /&gt;&amp;nbsp; 10050004 00000001 .data&amp;nbsp;&amp;nbsp; TEST2&amp;nbsp;&amp;nbsp; &amp;nbsp;(envm.c)&lt;BR /&gt;&amp;nbsp; 10050008 00000004 .data&amp;nbsp;&amp;nbsp; TEST3&amp;nbsp;&amp;nbsp; &amp;nbsp;(envm.c)&lt;BR /&gt;&amp;nbsp; 1005000C 00000001 .data&amp;nbsp;&amp;nbsp; TEST4&amp;nbsp;&amp;nbsp; &amp;nbsp;(envm.c)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to understand why TEST3 is aligned at 10050008 instead of 10050005&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding the following in my linker, the results were the same&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. = ALIGN (0x1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason for this? Is it normal? Can I force them to be 'one after the other' and still work as expected?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179974#M2614</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2020-10-29T09:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Linker / Compilier Auto aligh uint_32's?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179975#M2615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carl,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what you see is normal behaviour of compiler, where all 32-bit value is aligned. That's because of bus access optimization.&lt;/P&gt;&lt;P&gt;You can use &lt;STRONG&gt;#pragma align&lt;/STRONG&gt; as the compiler directive to change default alignement of a variable.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 17:25:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179975#M2615</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2011-01-31T17:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Linker / Compilier Auto aligh uint_32's?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179976#M2616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would have though that . = ALIGN (0x01); would have worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, we ended up using a slightly different techniques to get around the issue we were having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Carl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 05:21:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179976#M2616</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2011-02-01T05:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Linker / Compilier Auto aligh uint_32's?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179977#M2617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You know, accessing unaligned variables can have impact not only to linker, but also to compiler- depends on architecture (getting each byte and assembling a 32bit value). That's why the #pragma is used during compilation time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 06:06:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179977#M2617</guid>
      <dc:creator>JuroV</dc:creator>
      <dc:date>2011-02-01T06:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Linker / Compilier Auto aligh uint_32's?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179978#M2618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes sense, thanks JuroV!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 06:15:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Linker-Compilier-Auto-aligh-uint-32-s/m-p/179978#M2618</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2011-02-01T06:15:50Z</dc:date>
    </item>
  </channel>
</rss>

