<name>_size variable is no longer needed, since we don't copy the code.
authorMichael Brown <mcb30@etherboot.org>
Tue, 2 May 2006 16:38:46 +0000 (16:38 +0000)
committerMichael Brown <mcb30@etherboot.org>
Tue, 2 May 2006 16:38:46 +0000 (16:38 +0000)
However, it's worth adding a .size directive so that objdump reports the
correct sizes for the code fragments.

src/arch/i386/include/librm.h

index 7171448..76ef8d6 100644 (file)
@@ -77,7 +77,6 @@ extern void remove_from_rm_stack ( void *data, size_t size );
 /* REAL_FRAGMENT: Declare and define a real-mode code fragment in .text16 */
 #define        REAL_FRAGMENT( name, asm_code_str )                             \
        extern void name ( void );                                      \
 /* REAL_FRAGMENT: Declare and define a real-mode code fragment in .text16 */
 #define        REAL_FRAGMENT( name, asm_code_str )                             \
        extern void name ( void );                                      \
-       extern char name ## _size[];                                    \
        __asm__ __volatile__ (                                          \
                ".section \".text16\"\n\t"                              \
                ".code16\n\t"                                           \
        __asm__ __volatile__ (                                          \
                ".section \".text16\"\n\t"                              \
                ".code16\n\t"                                           \
@@ -85,8 +84,7 @@ extern void remove_from_rm_stack ( void *data, size_t size );
                #name ":\n\t"                                           \
                asm_code_str "\n\t"                                     \
                "ret\n\t"                                               \
                #name ":\n\t"                                           \
                asm_code_str "\n\t"                                     \
                "ret\n\t"                                               \
-               #name "_end:\n\t"                                       \
-               ".equ " #name "_size, " #name "_end - " #name "\n\t"    \
+               ".size " #name ", . - " #name "\n\t"                    \
                ".code32\n\t"                                           \
                ".previous\n\t"                                         \
                : :                                                     \
                ".code32\n\t"                                           \
                ".previous\n\t"                                         \
                : :                                                     \