Skip to content
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

ld_align_segment_start does not work properly when used together with follows_vram #385

Open
AngheloAlf opened this issue Jul 12, 2024 · 0 comments

Comments

@AngheloAlf
Copy link
Collaborator

The alignment directive is emitted, but then the segment still uses the end vram of the follows_vram segment instead of using the aligned vram.

For example with the given input

  - name: more_funcs
    dir: more_funcs
    type: code
    start: 0x5BF20
    vram: 0x800BF080
    bss_size: 0x1F6F0
    follows_vram: app_render
    ld_align_segment_start: 0x40

The generated linker script says

    }
    __romPos += SIZEOF(.app_render);
    __romPos = ALIGN(__romPos, 16);
    . = ALIGN(., 16);
    app_render_ROM_END = __romPos;
    app_render_VRAM_END = .;

    __romPos = ALIGN(__romPos, 0x40);
    _ = ALIGN(., 0x40);
    more_funcs_ROM_START = __romPos;
    more_funcs_VRAM = ADDR(.more_funcs);
    .more_funcs app_render_VRAM_END : AT(more_funcs_ROM_START)
    {

Ideally the .more_funcs app_render_VRAM_END : AT(more_funcs_ROM_START) line wouldn't use the app_render_VRAM_END, but instead it would use the ALIGNed address.

Also I just noted the wrong _ = ALIGN(., 0x40);. It should be . = ALIGN(., 0x40);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant