Building the following code with the command:
sdcc -mhc08 --xram-loc 0x0100 test.c
produces a file with test1 (in XABS1) correctly located at 0x0100, test2 (in XISEG) correclty located at 0x0101, but XISEG has a value of 0x0100 so __sdcc_init_data writes the initializer for test2 in the wrong location. If built for mcs51 instead of hc08 then it looks okay.
Tested with version (sdcc -v):
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.4 #6620 (Jul 10 2011) (Linux)
test.c:
__xdata __at (0x0100) char test1 = 1;
__xdata char test2 = 2;
void main(void) {
}
map file
Fixed in SDCC 3.3.2 #8934.