This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to suppress linker warnings in scatter file

I have a projects that build multiple targets, using a single scatter file.  For some targets the linker gives "warning: L6314W: No section matches pattern ...."

Is there a way to suppress this warning using a directive in the scatter file, rather than via the command line --diag_suppress ?

TIA

Parents
  • I am not aware of a way to suppress diagnostics inside the scatter file. So, maybe 2 ideas:

    1) by using the scatter file preprocessing (https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_pge1362066010024.htm) a target specific macro could be used to create execution regions only when required.

    2) a little dummy module could be used to create a symbol with 0 byte size for the either empty execution region. For example, the scatter file has:

    RW_TEST +0 {
    * (.text_test)
    }

    Then a little C module for Arm Compiler 6 with such content would do it:

    #pragma clang diagnostic ignored "-Winvalid-noreturn"
    extern void text_test_dummy( void ) ;
    __attribute__((noreturn,used,section(".text_test"))) void text_test_dummy( void )
    {
    }

    In the mapfile is then this:

    Execution Region RW_TEST (Exec base: 0x20008604, Load base: 0x00001fb0, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)

    Exec Addr Load Addr Size Type Attr Idx E Section Name Object

    0x20008604 0x00001fb0 0x00000000 Code RO 17 .text_test text_test_dummy.o

    Maybe some of this helps.

Reply
  • I am not aware of a way to suppress diagnostics inside the scatter file. So, maybe 2 ideas:

    1) by using the scatter file preprocessing (https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_pge1362066010024.htm) a target specific macro could be used to create execution regions only when required.

    2) a little dummy module could be used to create a symbol with 0 byte size for the either empty execution region. For example, the scatter file has:

    RW_TEST +0 {
    * (.text_test)
    }

    Then a little C module for Arm Compiler 6 with such content would do it:

    #pragma clang diagnostic ignored "-Winvalid-noreturn"
    extern void text_test_dummy( void ) ;
    __attribute__((noreturn,used,section(".text_test"))) void text_test_dummy( void )
    {
    }

    In the mapfile is then this:

    Execution Region RW_TEST (Exec base: 0x20008604, Load base: 0x00001fb0, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)

    Exec Addr Load Addr Size Type Attr Idx E Section Name Object

    0x20008604 0x00001fb0 0x00000000 Code RO 17 .text_test text_test_dummy.o

    Maybe some of this helps.

Children
No data