rui314/mold

Linking fails when building guitarix from source

Closed this issue · 1 comments

I get this error message when building guitarix from source, with -fuse-ld=mold enabled. Linking doesn't fail when using ld.

mold: fatal: ../src/gx_head/guitarix.lds:1: __rt_text__start = ADDR(.rt.text);
                                            ^ unknown linker script token

mold doesn't support that linker script command. But it looks like the use of the linker script is not necessary for that program.

https://github.com/brummer10/guitarix/blob/9013250487851fb98bb936c9ca5d210cfb560ef0/trunk/src/headers/gx_compiler.h#L7-L8

They should just rename the sections from .rt.data / .rt.text to rt_data and rt_text and then the linker will automatically define __start_rt_data, __stop_rt_data, __start_rt_text, __stop_rt_text symbols.