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

ARM GNU GCC doesn't support section pragmas

for ARMClang toolchain in ARM DS, it support section pragmas in the following format.

#pragma clang section bss = ".uncached_bss" data = ".uncached_data"
int test= 0;

int test2= 0;
#pragma clang section bss="" data="" text=""

however, it seems that ARM GNU toolchain doesn' support this similar feature, in deed, gcc support through attribute , for example,
int __attribute__((__section__(".uncached_bss"))) test= 0 ;

int __attribute__((__section__(".uncached_bss"))) test2= 0 ;

without section pragma,  programmer must add attributes for the variables one by one.

so I advise ARM GNU toolchain to add simlilar support.

Best Regards,
Zhang Shiping.

Parents
  • Does the issue have anything to do with autoat or --no_autoat?

    https://developer.arm.com/documentation/dui0803/a/Using-scatter-files/Automatic-placement-of---at-sections

    This is exactly what I want to do actually. 

    But I can't write to the correct address. I think it has something to do with the automatic filling of addresses.

    COMPILER_OPT  = -D$(MCU)
    COMPILER_OPT += -mfloat-abi=$(FLOAT)
    COMPILER_OPT += -mfpu=$(FPU)
    COMPILER_OPT += -mcpu=cortex-m23
    COMPILER_OPT += -mthumb
    COMPILER_OPT += -Os
    COMPILER_OPT += -flto
    COMPILER_OPT += -fdata-sections
    COMPILER_OPT += -ffunction-sections
    COMPILER_OPT += -fno-exceptions
    COMPILER_OPT += -fno-rtti
    COMPILER_OPT += -fno-use-cxa-atexit
    COMPILER_OPT += -fno-threadsafe-statics
    COMPILER_OPT += -ffast-math
    COMPILER_OPT += -fshort-enums
    COMPILER_OPT += -fno-common
    #COMPILER_OPT += -falign-functions=4
    COMPILER_OPT += -fsingle-precision-constant
    
    LINKER_OPT  = -flto
    LINKER_OPT += -Wl,--gc-sections
    LINKER_OPT += -Wl,--sort-section=alignment
    LINKER_OPT += -Wl,--cref
    LINKER_OPT += -Wl,--print-memory-usage
    LINKER_OPT += -Wl,--no-wchar-size-warning
    LINKER_OPT += -static
    LINKER_OPT += --specs=nano.specs
    LINKER_OPT += --specs=nosys.specs

Reply
  • Does the issue have anything to do with autoat or --no_autoat?

    https://developer.arm.com/documentation/dui0803/a/Using-scatter-files/Automatic-placement-of---at-sections

    This is exactly what I want to do actually. 

    But I can't write to the correct address. I think it has something to do with the automatic filling of addresses.

    COMPILER_OPT  = -D$(MCU)
    COMPILER_OPT += -mfloat-abi=$(FLOAT)
    COMPILER_OPT += -mfpu=$(FPU)
    COMPILER_OPT += -mcpu=cortex-m23
    COMPILER_OPT += -mthumb
    COMPILER_OPT += -Os
    COMPILER_OPT += -flto
    COMPILER_OPT += -fdata-sections
    COMPILER_OPT += -ffunction-sections
    COMPILER_OPT += -fno-exceptions
    COMPILER_OPT += -fno-rtti
    COMPILER_OPT += -fno-use-cxa-atexit
    COMPILER_OPT += -fno-threadsafe-statics
    COMPILER_OPT += -ffast-math
    COMPILER_OPT += -fshort-enums
    COMPILER_OPT += -fno-common
    #COMPILER_OPT += -falign-functions=4
    COMPILER_OPT += -fsingle-precision-constant
    
    LINKER_OPT  = -flto
    LINKER_OPT += -Wl,--gc-sections
    LINKER_OPT += -Wl,--sort-section=alignment
    LINKER_OPT += -Wl,--cref
    LINKER_OPT += -Wl,--print-memory-usage
    LINKER_OPT += -Wl,--no-wchar-size-warning
    LINKER_OPT += -static
    LINKER_OPT += --specs=nano.specs
    LINKER_OPT += --specs=nosys.specs

Children