<?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: The segment information from objdump is not consistent with the information specified in the Linker file. in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839306#M4016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK,thks very much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2019 02:37:56 GMT</pubDate>
    <dc:creator>kongdetao</dc:creator>
    <dc:date>2019-01-02T02:37:56Z</dc:date>
    <item>
      <title>The segment information from objdump is not consistent with the information specified in the Linker file.</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839304#M4014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Development environment:&amp;nbsp; S32K148+ S32 Develop Studio for arm&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now compile a S32K148 program, and then use the objdump tool to print out the segment information of the file, and found a problem: the result of objdump shows that the LMA address of the code segment is inconsistent with the address specified by Linker?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The results of objdump are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Sections:&lt;BR /&gt;Idx Name Size VMA LMA File off Algn&lt;BR /&gt; 0 .interrupts 00000400 00000000 00000000 00010000 2**2&lt;BR /&gt; CONTENTS, ALLOC, LOAD, READONLY, DATA&lt;BR /&gt; 1 .flash_config 00000010 00000400 00000400 00010400 2**0&lt;BR /&gt; CONTENTS, ALLOC, LOAD, READONLY, DATA&lt;BR /&gt; 2 .text 00002178 00000410 00000410 00010410 2**2&lt;BR /&gt; CONTENTS, ALLOC, LOAD, READONLY, CODE&lt;BR /&gt; 3 .interrupts_ram 00000400 1ffe0000 1ffe0000 00030000 2**0&lt;BR /&gt; ALLOC&lt;BR /&gt; 4 .&lt;STRONG&gt;data 00000348 1ffe0400 00002588 00020400 2&lt;/STRONG&gt;**3&lt;BR /&gt; CONTENTS, ALLOC, LOAD, DATA&lt;BR /&gt; 5 .&lt;STRONG&gt;code 00000000 1ffe0748 1ffe0748 0002f000&lt;/STRONG&gt; 2**0&lt;BR /&gt; CONTENTS&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Linker的内容如下：&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;STRONG&gt;.data&lt;/STRONG&gt; : AT(__DATA_ROM)&lt;BR /&gt; {&lt;BR /&gt; . = ALIGN(4);&lt;BR /&gt; __DATA_RAM = .;&lt;BR /&gt; __data_start__ = .; /* Create a global symbol at data start. */&lt;BR /&gt; *(.data) /* .data sections */&lt;BR /&gt; *(.data*) /* .data* sections */&lt;BR /&gt; . = ALIGN(4);&lt;BR /&gt; __data_end__ = .; /* Define a global symbol at data end. */&lt;BR /&gt; } &amp;gt; m_data&lt;/P&gt;&lt;P&gt;__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);&lt;BR /&gt; __CODE_ROM = __DATA_END; /* Symbol is used by code initialization. */&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.code&lt;/STRONG&gt; : AT(__CODE_ROM)&lt;BR /&gt; {&lt;BR /&gt; . = ALIGN(4);&lt;BR /&gt; __CODE_RAM = .;&lt;BR /&gt; __code_start__ = .; /* Create a global symbol at code start. */&lt;BR /&gt; __code_ram_start__ = .;&lt;BR /&gt; *(.code_ram) /* Custom section for storing code in RAM */&lt;BR /&gt; . = ALIGN(4);&lt;BR /&gt; __code_end__ = .; /* Define a global symbol at code end. */&lt;BR /&gt; __code_ram_end__ = .;&lt;BR /&gt; } &amp;gt; m_data&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Dec 2018 02:38:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839304#M4014</guid>
      <dc:creator>kongdetao</dc:creator>
      <dc:date>2018-12-29T02:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: The segment information from objdump is not consistent with the information specified in the Linker file.</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839305#M4015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You are probably referring to LMA address of &lt;STRONG&gt;&lt;EM&gt;.code&lt;/EM&gt;&lt;/STRONG&gt; section:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;5 .code 00000000 1ffe0748 1ffe0748 0002f000&amp;nbsp;2**0&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The load address is calculated by the expression __CODE_ROM:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;__DATA_END &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; __DATA_ROM &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__data_end__ &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; __data_start__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
__CODE_ROM &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; __DATA_END&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Symbol is used by code initialization. */&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably expect the load address is located in rom 0x000028D0 instead of ram (0x1FFE0748)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to be caused by the fact the &lt;STRONG&gt;&lt;EM&gt;.code&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;section is zero size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it has a non-zero size the load address should match with the linker file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make an easy check by adding the attribute below prior to any your C function e.g. main():&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;section&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".code_ram"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jan 2019 22:41:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839305#M4015</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2019-01-01T22:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: The segment information from objdump is not consistent with the information specified in the Linker file.</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839306#M4016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK,thks very much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2019 02:37:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-segment-information-from-objdump-is-not-consistent-with-the/m-p/839306#M4016</guid>
      <dc:creator>kongdetao</dc:creator>
      <dc:date>2019-01-02T02:37:56Z</dc:date>
    </item>
  </channel>
</rss>

