Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363104 - Add gnu alignment support to obj.$$alloc
Summary: Add gnu alignment support to obj.$$alloc
Status: CLOSED FIXED
Alias: None
Product: RTSC
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Russo CLA
QA Contact:
URL:
Whiteboard: target:3.23
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-07 17:01 EST by Scott Gary CLA
Modified: 2011-11-24 13:10 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Gary CLA 2011-11-07 17:01:46 EST
Currently gnu targets are built with ITarget.alignDirectiveSupported as the default of "false". This requires runtime fix ups of statically allocated buffers.  For example, SYS/BIOS's HeapBuf and Task use Memory.staticPlace, which calls obj.$$alloc().  Currently obj.$$alloc() only supports TI alignment, so alignment fix-up at runtime is needed for gnu. 

Request that obj.$$alloc() be enhanced to support alignment for gnu too.  There is no pragma comparable to TI's for this, but "attribute" can be used.  From the description of the "aligned" attribute in the gcc docs:

aligned (alignment)

This attribute specifies a minimum alignment for the variable or structure field,
measured in bytes. For example, the declaration:

int x __attribute__ ((aligned (16))) = 0;

causes the compiler to allocate the global variable x on a 16-byte boundary.
Comment 1 Dave Russo CLA 2011-11-07 18:20:09 EST
in xdc/services/intern/gen/Config.java we generate GNU attributes for section placement but not alignment.  It looks like we can simply add alignment in the same way.
Comment 2 Dave Russo CLA 2011-11-07 20:01:19 EST
"fixed" in xdc-y09 by adding GCC alignment directives when alignment is non-zero and GCC version is > 4.  See xdc/services/internal/gen/Config.java
Comment 3 Scott Gary CLA 2011-11-14 19:23:34 EST
Verified new attribute alignment directives generated with new gnu builds.  Looked at xdc/services/intern/gen/Config.java.
Comment 4 Dave Russo CLA 2011-11-24 13:10:25 EST
shipped in XDCtools 3.23 (http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_23_00_32)