Skip to content

Commit

Permalink
Add support (that maybe works?) for after min/max.
Browse files Browse the repository at this point in the history
  • Loading branch information
trhodeos committed Apr 1, 2018
1 parent 2d5f31a commit ef6df50
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ld.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@ SECTIONS {
_RomStart = _RomSize;
{{range .ObjectSegments -}}
_{{.Name}}SegmentRomStart = _RomSize;
..{{.Name}} {{if ne .Positioning.AfterSegment ""}} ADDR(..{{.Positioning.AfterSegment}}.bss) + SIZEOF(..{{.Positioning.AfterSegment}}.bss) {{else if not .Positioning.NoLoad}} {{.Positioning.Address}} {{end}} :
..{{.Name}}
{{if ne .Positioning.AfterSegment ""}}
ADDR(..{{.Positioning.AfterSegment}}.bss) + SIZEOF(..{{.Positioning.AfterSegment}}.bss)
{{else if ne (index .Positioning.AfterMinSegment 0) ""}}
MIN(
ADDR(..{{index .Positioning.AfterMinSegment 0}}.bss) + SIZEOF(..{{index .Positioning.AfterMinSegment 0}}.bss),
ADDR(..{{index .Positioning.AfterMinSegment 1}}.bss) + SIZEOF(..{{index .Positioning.AfterMinSegment 1}}.bss))
{{else if ne (index .Positioning.AfterMaxSegment 0) ""}}
MAX(
ADDR(..{{index .Positioning.AfterMaxSegment 0}}.bss) + SIZEOF(..{{index .Positioning.AfterMaxSegment 0}}.bss),
ADDR(..{{index .Positioning.AfterMaxSegment 1}}.bss) + SIZEOF(..{{index .Positioning.AfterMaxSegment 1}}.bss))
{{else if not .Positioning.NoLoad}}
{{.Positioning.Address}}
{{end}}
:
{
_{{.Name}}SegmentStart = .;
. = ALIGN(0x10);
Expand Down

0 comments on commit ef6df50

Please sign in to comment.