Greetings! Leon Bottou <[EMAIL PROTECTED]> writes:
> On Friday 15 April 2005 11:13 am, you wrote: > > There is also this annoying aspect about bfd that they define the > > reloc_howto_type to be constant, which on alpha, actually puts it into > > read-only memory, making your *(void **)& workaround segfault. > > Hmm. I had forgotten that hack. > What about this brutal solution? > > static void > alphaelf_write(void **pointer, void* value) > { > #if HAVE_MPROTECT > int pagesize = getpagesize(); > bfd_vma start = ptrvma(pointer) & ~(pagesize-1); > mprotect( vmaptr(start), pagesize, PROT_READ|PROT_WRITE); > #endif > *pointer = value; > } > This might work for machines implementing read-only memory this way, but would it not be more portable to redirect the howto pointer instead of the special_function pointer? (Haven't yet checked that this isn't const too.) I.e. make our own little table of howto structs initialized from the bfd versions then modified with a new special_function, then in fix_relocs, redirect the howto pointer to the new versions. BTW, committed a minor but important fix to the alpha relocation code a few days ago. Take care, > > > -- Camm Maguire [EMAIL PROTECTED] ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah _______________________________________________ Gcl-devel mailing list Gcl-devel@gnu.org http://lists.gnu.org/mailman/listinfo/gcl-devel