• 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 » C++ Exceptions - Compile/Linkage issues
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

Forums

C++ Exceptions - Compile/Linkage issues

  • Itay Chamiel
    Posted by Itay Chamiel
    on Mar 21 2012 12:12 PM
    Intellectual845 points

    Hi,

    I am running into a few issues that arise when C++ Exceptions are enabled in my project.

    1. In a large project, it is common that .c files are used alongside .cpp files. If exception handling is enabled in the project, however, the compiler will choke on every .c file with the error:

      Command-line error #593: exception handling option can be used only when compiling C++

      This forces me to have to manually go over each .c file and remove the checkbox that enables the --exceptions option in the project properties of CCS, a very tedious process. Wouldn't it be simpler if either (A) this were considered a warning by the compiler (and the option ignored), or (B) CCS would automatically prevent this option from affecting .c files?

    2. When enabling exceptions in a project the following linker warning appears:

      warning #10247-D: creating output section ".c6xabi.exidx" without a SECTIONS specification
      warning #10247-D: creating output section ".c6xabi.extab" without a SECTIONS specification

      Now, the first thing I try (since RTSC based projects normally don't need a custom linker command file) is to add the following to my .cfg:

      Program.sectMap[".c6xabi.exidx"] = "DDR3";
      Program.sectMap[".c6xabi.extab"] = "DDR3";

      This results in an warning and the lines are ignored:

      "./configPkg/linker.cmd", line 218: warning #10094-D: split placement (>>)
         ignored for ".c6xabi.exidx":  cannot split EH Index table

      ..and so I am forced to create a custom linker command file to link correctly. My point here is that this process is a hassle and should be automatically taken care of by the system.

    3. Once everything is in place, however, I have a problematic scenario. I am developing on a EVM6678, a multicore system. Typically I have all large shared, read-only sections in DDR and smaller, R/W sections in L2SRAM so that the different cores do not conflict. So, sections .text, .const, .cinit, .switch are all placed in DDR3 and the rest in L2SRAM. I have noticed that the .vecs section is modified at runtime (during the pre-main initialization) and so also place it in L2SRAM.

      There appears to be a tie between the two newly added sections and the .vecs section; they cannot be spaced too far apart. Now, if I place these sections in L2SRAM, a torrent of relocation overflow warnings are emitted by the linker - apparently they must be near .text. So, I place them in DDR3 and the link completes. However, if a large heap is defined in the .cfg it pushes the .text section further upwards in DDR memory (say, 0x88000000 instead of 0x80000000) and this causes the following linker message:

      warning #17003-D: relocation to symbol "__TI_exidx_linkto_scn_start_2"
         overflowed; the 32-bit relocated address 0xbc3f68c0 is too large to encode
         in the 31-bit signed PC-Relative field (type = 'R_C6000_PREL31' (25), file =
         "(unknown file)", offset = 0x00000000, section =
         ".c6xabi.exidx.vecs:app_pe66.oe66")
      warning #10015-D: output file "mydemo.out" cannot be loaded and run on a target
         system

      Now, this could be solved by defining the heap at runtime rather than at config time, or forcing the linker to insert .text lower than the heap (these are two ways to keep the .text in low DDR memory), but I am looking for a more elegant solution. For example, it would be nice if I could leave most of .c6xabi.exidx in DDR but move just the part that needs to be near .vecs into L2SRAM using a linker command. Is this possible?

      I am attaching a sample project that demonstrates this under CCS 5.1 and CGT 7.3.2.

      2514.mydemo.zip

    Thanks,

    -itay

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 21 2012 12:36 PM
    Mastermind40550 points

    I will address only number 3.  First, the EXIDX section absolutely must be one contiguous table.  Second, the relocation R_C6000_PREL31 should never overflow; the fact that it does is the subject of defect report SDSCM00042923.  See that defect report for potential workarounds.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 21 2012 12:41 PM
    Mastermind40550 points

    Itay Chamiel
    I have noticed that the .vecs section is modified at runtime (during the pre-main initialization)

    That's surprising.  Exactly what function does this?

    You should probably make a new post with issue number 2 in the BIOS forum.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Itay Chamiel
    Posted by Itay Chamiel
    on Mar 22 2012 05:02 AM
    Intellectual845 points

    Hi Archaeologist,

    1. Are you sure SDSCM0004292 is viewable outside TI? I can't find it on SDOWP.

    2. Sorry, I was wrong about .vecs, it is modified by my own code when I enable PCI interrupts via an Hwi_create call on core 0. Since I don't enable this interrupt on the other cores, I still think .vecs ought to remain in L2SRAM.

    Thanks!

    -itay

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 22 2012 08:00 AM
    Mastermind40550 points

    I'm sorry, that was a typo; it's SDSCM00042923.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Itay Chamiel
    Posted by Itay Chamiel
    on Mar 22 2012 10:21 AM
    Intellectual845 points

    The defect report raises more questions that it answers. The workaround suggested is: "Allocate .c6xabi.exidx and .c6xabi.extab and all text sections within 2^31 bytes of each other, or just ignore the warnings."

    But, that's exactly how I'm already allocating my sections. The problem seems to be with .vecs, which is not a text section. (Or is it?) Also, from the last part of the sentence I can understand that this warning is entirely meaningless. So, should I simply ignore it?

    Thanks.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 22 2012 11:33 AM
    Mastermind40550 points

    That defect report is still being analyzed; a conclusion has not been reached.  I believe it should be safe to ignore the warnings, but there is some suggestion that exception handling could fail in the presence of such warnings (yet to be proven).

    There should not be any references (by addressing mode or relocations) in .vecs to EXIDX or EXTAB sections, or vice versa.   Hmm... I hadn't noticed before that that's exactly what your quoted error message says.  May I see your linker map file (--map_file), or at least those parts relevant to .vecs, EXIDX, and EXTAB?

    How are you creating .vecs?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Itay Chamiel
    Posted by Itay Chamiel
    on Mar 22 2012 11:56 AM
    Intellectual845 points

    There's a sample project attached to my first post.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Itay Chamiel
    Posted by Itay Chamiel
    on Mar 23 2012 04:58 AM
    Intellectual845 points

    Archaeologist

    You should probably make a new post with issue number 2 in the BIOS forum.

    Done, see http://e2e.ti.com/support/embedded/bios/f/355/t/177495.aspx .

    I also asked about issue number 1 in the CCS forum, see http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/177466.aspx .

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 23 2012 10:23 AM
    Mastermind40550 points

    Archaeologist
    There should not be any references (by addressing mode or relocations) in .vecs to EXIDX or EXTAB sections, or vice versa.

    Upon further reflection, I don't see any reason why it would be a problem to have an entry in EXIDX for .vecs, so I must retract this statement.

    As I said, the defect is still being analyzed, but it should be safe to ignore the warning when it refers to .vecs.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Joachim Siegler
    Posted by Joachim Siegler
    on Jun 28 2012 08:07 AM
    Intellectual495 points

    Archaeologist,

    are there any new information that belongs to the relocation overflow problem?

    Regards
    Jo

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Jun 28 2012 09:46 AM
    Mastermind40550 points

    This bug is still marked open, so no, there is no new information.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Itay Chamiel
    Posted by Itay Chamiel
    on Jul 25 2012 05:31 AM
    Intellectual845 points

    As far as I can see this bug from version 7.3.2 no longer occurs in all versions since 7.3.4 (I haven't checked 7.3.3). For some reason in SDOWP it's marked as fixed in 7.3.5. Oddly enough, in the DefectHistory.txt file as of 7.3.7 this is still listed as a known issue.

    Can someone clarify the situation and fix the discrepancies?

    Thanks,

    -itay

    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