Still working on gathering a minimal case, but basically I have been changing my device driver to not have anything in the data segment.
Compiling with -fbaserel -msmall-code the driver compiles fine as long as there is still some data around, but as soon as no files has anything in the data segment (everything is in code and bss), compilation of the driver fails with:
Building a4091.device
objs/device.o: in function `init_device':
objs/device.o:(.text+0x54): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0xf0): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0xfc): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0x122): relocation truncated to fit: DREL16 against `.bss'
objs/device.o: in function `drv_expunge':
objs/device.o:(.text+0x180): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0x198): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0x1c6): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0x1f2): relocation truncated to fit: DREL16 against `.bss'
objs/device.o: in function `drv_open':
objs/device.o:(.text+0x224): relocation truncated to fit: DREL16 against `.bss'
objs/device.o:(.text+0x254): relocation truncated to fit: DREL16 against `.bss'
objs/device.o: in function `drv_close':
objs/device.o:(.text+0x26a): additional relocation overflows omitted from the output
My current workaround is to place the following in the code
Still working on gathering a minimal case, but basically I have been changing my device driver to not have anything in the data segment.
Compiling with -fbaserel -msmall-code the driver compiles fine as long as there is still some data around, but as soon as no files has anything in the data segment (everything is in code and bss), compilation of the driver fails with:
My current workaround is to place the following in the code
int fake_data[1] = {1};
but that seems like a bad solution.