Hi Thomas,

[Note: You sent this to g...@sourceware.org but the correct address to use is g...@gcc.gnu.org].

        int* pInt   = (int*)0x10002004;  //word-aligned
        char* pChar = (char* )0x10003005;  //non-word-aligned

        *pInt = 0x34;
        *pChar = 'A';

The assembly mnemonics for the above two statements are STR and STRB
respectively.

This I made part of the u-boot and build successfully for the smdk2400
platform. But when I debugged with GDB, *pChar = 'A' throwed an
exception.

What kind of exception ? There should be no restrictions on byte accesses to memory, unless the memory region itself is restricted to Priviledged access only.


So, the same source code and also the same ASM mnemonic works
differently with the code generation commands(i.e., gcc).

In this regard, I am searching for the gcc command line argument present
in the u-boot makefile which throws exception in GDB for accessing
non-word-aligned address that corresponds to char*.

Kindly give me useful tips.

If you add "-v" to the gcc command line that is being generated by your u-boot makefile then gcc will display the command line that it uses to invoke the compiler, assembler and linker.

If that does not work then you could try placing a small script in the execution search path ahead of the real gcc that echos its arguments and then calls the real gcc.

Cheers
  Nick

Reply via email to