0

I have few arrays defined in a c file and declared as extern in its header. the header is being included in several other files. It complies in MSVC however the armcc is throwing error. How do i resolve this issue?

/* example.c file */
const tUint32 BanD_arr[4]={....,....,....,};

void BandBits(){ 
...y = BanD_arr[x];...
}

/* example.h file */
extern const tUint32 BanD_arr[4];
Error form ARMCC 4.5.2 
Error: L6769E: Relocation #REL:0 in example.o(i.BandBits) with respect to BanD_arr. No GOTSLOTexists for symbol.
Fiddling Bits
  • 8,712
  • 3
  • 28
  • 46
Jay10
  • 1
  • 2
  • Is `example.h` `includ`ing whatever is `typedef`ing `tUint32`? – Fiddling Bits Oct 09 '15 at 13:14
  • It looks like straight forward code, and is a pretty esoteric error. (its nothing I've seen before, and searching for related information is pretty scarce and suggest this is a pretty obscure linker issue). You may want to try contacting keil/arm for help. – Russ Schultz Oct 09 '15 at 13:17
  • for what it's worth, this seems to be related to dynamic linking "global offset table". Do you mean to be using the dynamic linker? – Russ Schultz Oct 09 '15 at 13:20
  • 1
    In general, you should not use hand-crafted fixed bitwidth types, but `stdint.h` types (here: `uint32_t`). If your compiler does not provide this, get a new/other compiler, because that means it is not well-maintained and likey broken otherwise, too. – too honest for this site Oct 09 '15 at 13:38
  • @FiddlingBits yes example.h includes it – Jay10 Nov 06 '15 at 09:33
  • The compilation commands are lacking. It is not possible to reason about the error with the given info. – A. K. Feb 23 '23 at 15:36

0 Answers0