• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Development Tools » TI C/C++ Compiler » TI C/C++ Compiler - Forum » Relocatable Linker Version 4.9.6 generates wrong MAP file information
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

Relocatable Linker Version 4.9.6 generates wrong MAP file information

Relocatable Linker Version 4.9.6 generates wrong MAP file information

This question is answered
Pashan None
Posted by Pashan None
on Jul 07 2012 11:02 AM
Genius3450 points
Relocate_Linker_Bug.zip

Hello Support,

I am attaching ZIP file. Please unzip to a FOLDER.

It contains relocate_link_bug.bat file.

If you run the BAT file with 4.9.6 Linker, you will generate BSW_Boot_lno.map file.

In the MAP file you will see that .text section starts at 0x20 instead of 0x0.

Even thugh you will see the symbol Write_32_Bit_To_CRC_Low_Register at 0x11 within MAP file.

This symbol is within read_flash_area.obj (.text) section.

Question is why this symbol is beyond the MAP file specified region.

Please help.

Thank you.

Regards

Pashan

 

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • AartiG
    Posted by AartiG
    on Jul 10 2012 10:16 AM
    Guru70585 points

    Typically when creating a relocatable module the linker is concerned with creating the output sections but not actually allocating them. I'm not clear where the RAM memory configuration starting at 0x20 is coming from in the map file. If I try to relink the BSW_boot.lno to create an executable with a linker command file that specifies a different memory origin, then the .text gets allocated correctly to it and the symbol Write_32_bit_To_CRC_Low_Register gets the correct address at an offset of 0x11 from the start of .text.

    However, I'm not sure why it is setting the RAM origin to 0x20 and placing the .text there. I will try to get some other experts to take a look and comment.


    If a post answers your question please mark it with the "Verify Answer" button

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Douglas Gwyn
    Posted by Douglas Gwyn
    on Jul 11 2012 00:42 AM
    Expert2060 points

    I doubt that the linker is broken.  It appears that you have somehow defined the linker symbol START_OF_READ_FLASH_ROUTINE as 32 (aka 0x20).

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pashan None
    Posted by Pashan None
    on Jul 11 2012 16:41 PM
    Genius3450 points
    Relocate_Linker_Bug_MAP.zip

    Hello Aarti,

    I am attaching a new ZIP file.

    Please unzip to a FOLDER.

    Run Linker_Bug.bat file assuming Linker 4.9.6 path is correct as mentioned in the BAT file. Else change accordingly.

    You will see dbcBootCAN.map file is being created.

    The error I am talking about is as below:

    START_OF_READ_FLASH_ROUTINE symbol address is 0x80

    Write_32_Bit_To_CRC_Low_Register symbol address is 0x71

    That should not be the case because linkeri_boot_lno_ti.cmd contains

        .text :
                         {
                  .\read_flash_area.obj   (.text)  {START(START_OF_READ_FLASH_ROUTINE) END(END_OF_READ_FLASH_ROUTINE)}                  
                  *   (.text)
                         }          

    Write_32_Bit_To_CRC_Low_Register symbol is afunction within read_flash_area.obj.

    This is the BUG I am talking about.

    In my previous mail, I provided you the root cause.

    In this mail, I am showing you the end result of the error.

    Please help soon.

    Thank you.

    Regards

    Pashan

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wolf
    Posted by Wolf
    on Jul 12 2012 05:35 AM
    Intellectual915 points

    When I run Linker_Bug.bat I don't see anywhere actually using linkeri_boot_lno_ti.cmd. As such, I see START_OF_READ_FLASH_ROUTINE=0x80 as you say.

    If I add linkeri_boot_lno_ti.cmd to the last link command in Linker_Bug.bat before the other .cmd files, then the value becomes START_OF_READ_FLASH_ROUTINE=0xf970.  I have no idea if that is the value you expect because I don't know where in the .cmd file order it belongs, but since I don't see the .cmd file being used in the steps you sent I want to clarify where linkeri_boot_lno_ti.cmd is supposed to being used.


    EDIT:

    I found the command in relocate_link_bug.bat which uses linkeri_boot_lno_ti.cmd and links read_flash_area.obj


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wolf
    Posted by Wolf
    on Jul 12 2012 06:43 AM
    Intellectual915 points

    In that relocatable link step that uses linkeri_boot_lno_ti.cmd and links in read_flash_area.obj, the linker command file says to create symbol START_OF_READ_FLASH_ROUTINE and set it equal to the beginning of the .text section from the read_flash_area.obj file.  But because this is a relocatable link, the .text section from read_flash_area.obj will be allocated at least one more time in a later link, and so the address of Write_32_Bit_To_CRC_Low_Register (which is 11 bytes into the .text section from what I can see) will change, and will virtually start at zero until the absolute link, but START_OF_READ_FLASH_ROUTINE will continue to point to where the .text section from read_flash_area.obj is allocated.

    I'm not sure how the interaction between the symbol at the beginning of the .text section from a file, and the relocation address of a function within that section is intended to be maintained during multiple partial links, and will need to ask a few other developers who are out this week.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pashan None
    Posted by Pashan None
    on Jul 12 2012 10:34 AM
    Genius3450 points
    Relocate_Linker_Bug_Compiler_4.6.4.zip

    Hello Support,

    I am attaching the file.

    Please unzip to a sub-folder.

    From the previous post, I just modified relocate_linker_bug.bat file to use 4.6.4 Linker.

    If you run the same steps as before you will see that within dbcBootCAN.MAP file

    START_OF_READ_FLASH_ROUTINE is at 0x60

    Write_32_Bit_To_CRC_Low_Register is at 0x73

    This is correct behaviour as expected.

    Hence, I think 4.9.6 Linker is having some BUG.

    Please help me decipher this discrepancy. Let me know if you need any more information to understand this BUG.

    Thank you.

    Regards

    Pashan

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wolf
    Posted by Wolf
    on Jul 25 2012 16:48 PM
    Intellectual915 points

    Please note that I am still looking at this on and off and talking to others.  The test case is complex, and it is not clear how the various features are intended (from the point of view of the compiler tools) to interact thru so many and different relocatable links.

    I've noted that the allocation of the two symbols varies greatly between the two versions and am trying to understand the differences to find where an error might have occurred.

    Version 4.6.4 (reportedly correct)

     BSW_Boot.ofd:        1339 START_OF_REA... 0x00000020 defined   .text           global  none
     dbcBootCAN.ofd:     10285 START_OF_REA... 0x00000000 defined   .text:below_... global  none
     dbcBootCAN_B.ofd:    7351 START_OF_REA... 0x00000020 defined   .text:below_... global  none
     dbcBootCANout.ofd:  10191 START_OF_REA... 0x00000060 defined   .boot           global  none

     BSW_Boot.ofd:        1343 Write_32_Bit... 0x00000031 defined   .text           global  function
     dbcBootCAN.ofd:     10289 Write_32_Bit... 0x00000011 defined   .text:below_... global  function
     dbcBootCAN_A.ofd:    3256 Write_32_Bit... 0x00000000 undefined N/A             global  none
     dbcBootCAN_B.ofd:    7355 Write_32_Bit... 0x00000031 defined   .text:below_... global  function
     dbcBootCANout.ofd:  10195 Write_32_Bit... 0x00000071 defined   .boot           global  function


    Version 4.9.6 (reportedly wrong)

     BSW_Boot.ofd:        1680 START_OF_REA... 0x00000020 defined   .text           global  none
     dbcBootCAN.ofd:     14021 START_OF_REA... 0x00000020 defined   .text:below_... global  none
     dbcBootCAN_B.ofd:    8926 START_OF_REA... 0x00000020 defined   .text:below_... global  none
     dbcBootCANout.ofd:  13852 START_OF_REA... 0x00000080 defined   .boot           global  none

     BSW_Boot.ofd:        1684 Write_32_Bit... 0x00000011 defined   .text           global  function
     dbcBootCAN.ofd:     14025 Write_32_Bit... 0x00000011 defined   .text:below_... global  function
     dbcBootCAN_A.ofd:    3860 Write_32_Bit... 0x00000000 undefined N/A             global  none
     dbcBootCAN_B.ofd:    8930 Write_32_Bit... 0x00000011 defined   .text:below_... global  function
     dbcBootCANout.ofd:  13856 Write_32_Bit... 0x00000071 defined   .boot           global  function

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pashan None
    Posted by Pashan None
    on Aug 03 2012 10:50 AM
    Genius3450 points

    Hello Wolf/Aarti,

    Any news about this probelm described in this mail chanin?

    Thank you.

    Regards

    Pashan

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Pashan None
    Posted by Pashan None
    on Aug 30 2012 08:54 AM
    Genius3450 points

    Hello Worl/Aarti,

    Can you please help me with this BUG I am talking about?

    I am eagerly waiting to hear from you regarding the status of this BUG.

    Any help is appreciated.

    Or, at least tell me the BUG Report Number within ClearQuest.

    Thank you.

    Regards

    Pashan

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wolf
    Posted by Wolf
    on Aug 30 2012 14:03 PM
    Verified Answer
    Verified by Pashan None
    Intellectual915 points

    I've created defect SDSCM00045232 with the information from this post.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use