#258 [GPLINK] error: multiple sections using address 0xYYYY


On 14. 11. 2012 17:13, Diego Herranz wrote:


First of all, I know this is a sdcc mailing list but since gputils developers are also involved in sdcc project and this mail is somehow related to sdcc, I thought this was the right place

In the code I attach (test.c):
If array1 size is an odd number of bytes (i.e. if NO_OF_STRINGS * STRING_LENGTH is an odd number) the first byte of array2 overlaps and this gplink error is shown:

error: multiple sections using address 0x1038

If array1 size is an even number of bytes, everything works ok.

The asm file (file.asm) seems to be fine so I guess it has something to do with even addresses alignment and gplink, but what is the precise explanation? Or is it a bug? It seems that starting the array at an odd address (0x1001) is not a problem though.

sdcc command:
sdcc --use-non-free -mpic16 -p18f4550 test.c

gplink-0.14.3 #861 (Nov 14 2012)
sdcc 3.2.1 #8039 (Jul 13 2012) (Linux)

Keep these great projects going!

Thank you very much!


  • Borut Ražem

    Borut Ražem - 2012-11-15

    On 14. 11. 2012 20:00, Borut Ražem wrote:

    Linking the test.o object file with mplink uncovers the real problem:
    Error - Absolute code section 'S_test__array1' must start at a word-aligned address.

    So it seems that you found two bugs, one in sdcc and the other in gplink:
    - sdcc shouldn't generate the code section on odd address
    - gplink should generate the correct error message.

    On 14. 11. 2012 22:19, Borut Ražem wrote:

    After taking a more detailed look to the c source I saw that you forced the compiler to generate the array starting on odd address and it did exactly what you told him, so there are two possible approaches:
    - implement additional check in sdcc pic16 code generator to catch such errors or
    - just pass the generated code to the linker and leave the decision to it. This is how it is currently handled.

    If the second approach is acceptable then this is not a sdcc bug.


    Last edit: Borut Ražem 2012-11-15
  • Borut Ražem

    Borut Ražem - 2012-11-15
    • status: open --> closed
  • Borut Ražem

    Borut Ražem - 2012-11-15

    Fixed in svn revision #886.




Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks