This is an archive of the discontinued LLVM Phabricator instance.

[MSP430] Use R_MSP430_16_BYTE type for FK_Data_2 fixup
ClosedPublic

Authored by krisb on Nov 16 2018, 2:17 AM.

Details

Summary

Linker fails to link example like this (simplified case from newlib
sources):

$ cat test.c

extern const char _ctype_b[];
struct _t { char *ptr; };
struct _t T = { ((char *) _ctype_b + 3) };

$ cat ctype.c

char _ctype_b[4] = { 0, 0, 0, 0 };

LD: test.o:(.data+0x0): warning: internal error: unsupported relocation error

We also follow gnu toolchain here, where 2-byte relocation mapped to
R_MSP430_16_BYTE, instead of R_MSP430_16.

Diff Detail

Event Timeline

krisb created this revision.Nov 16 2018, 2:17 AM
asl accepted this revision.Nov 16 2018, 11:23 AM
This revision is now accepted and ready to land.Nov 16 2018, 11:23 AM
This revision was automatically updated to reflect the committed changes.