Automating linker file change
In don't know your linker, but the gcc linker can PROVIDE a label, which address can be used in the code. This feature is commonly used to inform the startupcode about the start and end of the DATA and BSS segments, so the BSS can be cleared and the DATA (in RAM) can be intialized from is copy in ROM.

Fragment from an (LPC1343) linkerscript I use:

.text :
{
    . = ALIGN(4);
    __text_start = .;
    PROVIDE(__text_start = __text_start);

            // all text segments are listed here

    . = ALIGN(4);
    __text_end = .;
    PROVIDE(__text_end = __text_end);
} &gt; rom 


The label __text_end will be at the address beyond the text. It can be used in the code for the CRC calculation.

Two remarks:


You say you check the code segment. Do you check the DATA segment (initialised global 
values) too?
If this task was put onto me I would consider to arrange things that the unused flash locations are filled with a known value, and arrange the checksumn over the total flash.