New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 3763: Reduce heap allocation in the GCC linker file #4014

Merged
merged 1 commit into from Apr 6, 2017

Conversation

Projects
None yet
6 participants
@mmahadevan108
Contributor

mmahadevan108 commented Mar 23, 2017

Reduce heap allocation in the GCC linker file, this should address the below issues.

#3978
#3763

Status

**READY

Issue 3763: Reduce heap allocation in the GCC linker file
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Mar 23, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 27, 2017

@mmahadevan108 How did you test this patch?

@SeppoTakalo

This comment has been minimized.

Contributor

SeppoTakalo commented Mar 27, 2017

I'm OK with the change but this does not fix the Issue #3978

Link: nanostack-border-router
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: ./BUILD/K66F/GCC_ARM/nanostack-border-router.elf section `.bss' will not fit in region `m_data'
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `m_data' overflowed by 19236 bytes
collect2: error: ld returned 1 exit status
[ERROR] /Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: ./BUILD/K66F/GCC_ARM/nanostack-border-router.elf section `.bss' will not fit in region `m_data'
/Users/septak01/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `m_data' overflowed by 19236 bytes
collect2: error: ld returned 1 exit status

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /Users/septak01/src/tmp/nanostack-border-router/mbed-os/tools/make.py -t GCC_ARM -m K66F --source . --build ./BUILD/K66F/GCC_ARM" in "/Users/septak01/src/tmp/nanostack-border-router"
---
@SeppoTakalo

This comment has been minimized.

Contributor

SeppoTakalo commented Mar 27, 2017

Note that it is the .bss section that does not fit into m_data

On K64F the .data and .bss sections seems to be going into m_data2 which is larger.

Also K64F linker file seems to have all sorts of uVisor related configs, can/should these be made to match?

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Mar 28, 2017

@SeppoTakalo . Thanks for testing. I will make a separate pull request to move .bss to data_2 Section.

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Mar 28, 2017

Tested using the mbed-os tests.

__stack_size__ = 0x400;
/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The

This comment has been minimized.

@0xc0170

0xc0170 Mar 28, 2017

Member

uvisor is not supported for these targets in this patch (most of them) ,and the comment makes reference to it. Shall be removed?

This comment has been minimized.

@mmahadevan108

mmahadevan108 Mar 30, 2017

Contributor

I left this allocation in heap in place just in case we decide to have uvisor on these targets in future.

__heap_size__ = 0x10000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

This comment has been minimized.

@0xc0170

0xc0170 Mar 28, 2017

Member

I believe I asked already, just to be certain - this has no affect for mbed 2 apps (no RTOS) ? As its for GCC

This comment has been minimized.

@mmahadevan108

mmahadevan108 Mar 30, 2017

Contributor

Yes the mbed 2 tests with GCC work after this change.

@adbridge

This comment has been minimized.

Contributor

adbridge commented Mar 30, 2017

@0xc0170 are you happy review comments are addressed ?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Mar 30, 2017

@0xc0170 are you happy review comments are addressed ?

Yes, we will fix stack sizes separately for all targets.

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Mar 30, 2017

@adbridge

This comment has been minimized.

Contributor

adbridge commented Mar 30, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Mar 30, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1802

All builds and test passed!

@mmahadevan108

This comment has been minimized.

Contributor

mmahadevan108 commented Apr 4, 2017

Anything else needed on this one?

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Apr 4, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 4, 2017

Anything else needed on this one?

LGTM

@sg- sg- merged commit 6c6c2fa into ARMmbed:master Apr 6, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-test Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mmahadevan108 mmahadevan108 deleted the NXPmicro:Update_GCC_ARM_Linker branch Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment