Skip to content

Commit

Permalink
Merge pull request #192 from sifive/support-max-heap-option
Browse files Browse the repository at this point in the history
Fix maximal-heap size  cause relocation error
  • Loading branch information
nategraff-sifive committed Nov 4, 2019
2 parents 09a8464 + 205bbfa commit 9ed8270
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions linker_script/sections/uninit_group.c++
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ UninitGroup::UninitGroup(const fdt &dtb, Memory logical_memory,
heap.output_name = "heap";

heap.add_command("PROVIDE( metal_segment_heap_target_start = . );");
heap.add_command(". = DEFINED(__heap_max) ? LENGTH(" + virtual_memory.name +
") - ( . - ORIGIN(" + virtual_memory.name +
") "
heap.add_command(". = DEFINED(__heap_max) ? MIN( LENGTH(" +
virtual_memory.name + ") - ( . - ORIGIN(" +
virtual_memory.name +
")) , 0x10000000"
") : __heap_size;");
heap.add_command("PROVIDE( metal_segment_heap_target_end = . );");
heap.add_command("PROVIDE( _heap_end = . );");
Expand Down

0 comments on commit 9ed8270

Please sign in to comment.