Find the answer to your Linux question:
Results 1 to 2 of 2
Hi I have problem with GNU linker. I will show you simple example how it appears. But basically if I have set one function to specified memory section and try ...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    1

    Linker script conflict error

    Hi

    I have problem with GNU linker.

    I will show you simple example how it appears. But basically if I have set one function to specified memory section and try to call function with string parameter. then linker says "causes a section type conflict".

    Code:
    char FooBar  __attribute__((section(".defined_section")));
    char TestFunction  __attribute__((section(".defined_section")));
    
    char FooBar(char * s)
    {
        if(s) return 1;
        else return 0;
    }
    
    void TestFunction(void)
    {
        FooBar(1);      // This works fine
        FooBar("1")    // This doesnt work, linker script says: " TestFunction causes a section type conflict"
    }
    So what is that error message? Google didnt find any solve for this.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The string literal "1" is const, whereas the signature of the function is non-const. Change the definition of FooBar to use a const char* instead of a char* as an argument.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...