https://sourceware.org/bugzilla/show_bug.cgi?id=34024

            Bug ID: 34024
           Summary: [bug] The attributes of the .rodata section have been
                    changed to WA
           Product: binutils
           Version: 2.41
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: zhenhangwang at huawei dot com
  Target Milestone: ---

hello.c

```
int  mymod_init(void)
{
    return 0;
}
```
gcc  -o hello.o -c hello.c
ld -r -o tmp_main.o hello.o -T tmp_main.ver

After linking, the attributes of the .rodata section have been changed to WA,
however lld is ok. I think it's unreasonable for `ld` to handle this way. Even
if an error occurs, the linker should **not** modify the permissions of the
`.rodata` section. This violates fundamental design principles.

I find it from linux:

https://elixir.bootlin.com/linux/v5.10.252/source/scripts/genksyms/genksyms.c#L691
https://elixir.bootlin.com/linux/v5.10.252/source/scripts/genksyms/genksyms.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to