On 30/05/2012 02:58, t-rexky wrote:
The NEXTSTEP assembler is a very heavily modified gas-1.38 and the .const directive indeed changes the output section.
Ok, it is unlikely that the .text and .const sections have a fixed distance, so PC-relative jump tables can't work.
ASM_OUTPUT_ADDR_VEC_ELT may be for you: http://gcc.gnu.org/onlinedocs/gccint/Dispatch-Tables.html#index-ASM_005fOUTPUT_005fADDR_005fVEC_005fELT-4612 As I suggested previously, alternatively the following should do the trick: #define JUMP_TABLES_IN_TEXT_SECTION 1But this is not the right solution, because the jump tables will stay in the .text segment instead of going to the .const segment as expected.
I am trying to figure out exactly what has changed in gcc, since the jump tables worked just fine with gcc-3.4.6 and the exact same target configuration I am using.
Look at the assembly output from gcc-3.4.6 and see the difference in the generated jump table code.
Since .const is a nonstandard keyword, it may not be used in many places in your gcc-4.6 source tree. Try to grep for it, and you will find where it has specifically be patched. There are probably other useful macros there.
-- Vincent Rivière