read-only memory protection on PA-RISC? - HP UX

This is a discussion on read-only memory protection on PA-RISC? - HP UX ; Why does this test http://milliways.chance.ru/~ark/constchk.c fail? I tried gcc32, gcc64, aC +ESconstlit - no difference...

+ Reply to Thread
Results 1 to 2 of 2

Thread: read-only memory protection on PA-RISC?

  1. read-only memory protection on PA-RISC?

    Why does this test

    http://milliways.chance.ru/~ark/constchk.c

    fail?

    I tried gcc32, gcc64, aC +ESconstlit - no difference


  2. Re: read-only memory protection on PA-RISC?

    ArkanoiD wrote:
    > Why does this test fail?
    > http://milliways.chance.ru/~ark/constchk.c
    > I tried gcc32, gcc64, aC +ESconstlit - no difference


    The right option would be +ESlit but that doesn't work.
    The real answer is that they ignored me when I reported it decades ago
    when 10.00 was introduced. (I also found a real problem with a new
    ld/dld feature that caused them to break it.)

    It works fine on IPF if you are on aCC6 or use +minshared.

    The PA C compiler is worried that dld may not be able to relocate
    addresses if it puts them in readonly memory. I.e. It won't work if
    PIC. For Solaris, dld goes ahead and only if it is different does it
    modify it, copy on write??

    It seems aCC3 copied HPC's "bug".

    The test isn't written properly and doesn't tell you it does a part way
    job. This is readonly:
    check((char*)pgms[0], 1);

    Remove this exit:
    puts ("Try to compile with GCC.");
    exit (1);

    Add this debug info:
    static void check(char *p, int is_const) {
    printf("Trying %p for %c\n", p, "WR"[is_const]);
    fflush(stdout);


+ Reply to Thread