0 Members and 4 Guests are viewing this topic.
#include <os.h>typedef struct type1_t { const char *s;} type1_t;typedef struct type2_t { const char *s1; const char *s2;} type2_t;int main(void) { type1_t test1 = {"foobar"}; type2_t test2 = {"foo", "bar"}; printf("test1.s: %s\n", test1.s); /* Prints "foobar" */ printf("test2.s1: %s\n", test2.s1); /* Should print "foo"; doesn't */ printf("test2.s2: %s\n", test2.s2); /* Should print "bar"; doesn't */ return 0;}
test1.s: foobartest2.s1: footest2.s2: bar
.LC2: .word .LC0 .word .LC1
int main(void) { type1_t test1 = {"foobar"}; type2_t test2 = {"foo", "bar"}; nl_relocdata((unsigned*)&test2.s1, 1); nl_relocdata((unsigned*)&test2.s2, 1); printf("test1.s: %s\n", test1.s); /* Prints "foobar" */ printf("test2.s1: %s\n", test2.s1); /* Should print "foo"; doesn't */ printf("test2.s2: %s\n", test2.s2); /* Should print "bar"; doesn't */ return 0;}
EDIT:Windows 7 x64 and Yagarto that uses the following versions:binutils: 2.21gcc: 4.6.2newlib: 1.19.0gdb: 7.3.1