[tp widget="default/tpw_default.php"]

can not fit the absolute section

0 Comments 18:06

can not fit the absolute section插图

In the default linker files, each memory region is, at most,256 bytes(one bank) in size. Since a section must fit within a memory region, any section which is larger than 256 bytes will trigger a can not fit the section error from the linker.

Can not fit the section error in C18?

Since a section must fit within a memory region, any section which is larger than 256 bytes will trigger a can not fit the section error from the linker. C18 doesn’t know anything about memory regions or anything else in the linker file, so it will place an unlimited amount of data into an idata/udata section.

Can not fit the section error from the linker?

Since a section must fit within a memory region, any section which is larger than 256 bytes will trigger a can not fit the section error from the linker. C18 doesn’t know anything about memory regions or anything else in the linker file, so it will place an unlimited amount of data into an idata/udata section.

Why can’t I move a 300-byte section in C18?

This is because C18 will place both a and b into a section named .udata_main.o, and the linker can’t place a 300-byte section into any of the 256-byte memory regions available. Note that the section name is based on the object file name, so if you were to move b into a file named foo.c, the linker error would be gone.

Related Post