NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/58298: hyperv.c triggers warning: ignoring changed section attributes for .text



>Number:         58298
>Category:       port-amd64
>Synopsis:       hyperv.c triggers warning: ignoring changed section attributes for .text
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 29 00:25:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, ...
>Organization:
.section .the,"netbsd",@foundation
>Environment:
>Description:
When compiling sys/arch/x86/x86/hyperv.c, the assembler complains:

/tmp//ccK3SGfU.s: Assembler messages:
/tmp//ccK3SGfU.s:5117: Warning: ignoring changed section attributes for .text

The relevant definition is:

        .section        .text,"aw" // line 5117
        .align 4096
        .type   hyperv_hypercall_page, @object
        .size   hyperv_hypercall_page, 4096
hyperv_hypercall_page:
        .string "\314"
        .zero   4094

This comes from:

static char hyperv_hypercall_page[PAGE_SIZE]
    __section(".text") __aligned(PAGE_SIZE) = { 0xcc };
>How-To-Repeat:
compile amd64/GENERIC
>Fix:
Yes, please!

This warning is confusing -- in parallel builds, attribution is not obvious -- and while the underlying symptom appears to be harmless for now, it seems dicey.

Can we convince gcc to emit the object with `.text' instead of `.section .text,"aw"' or something?  Or maybe call it .text.hypercall and use a linker script to make sure it's in the same segment as .text?

I tried putting const on hyperv_hypercall_page (and propagating it to the users), but this just changed it to `.section .text,"a"' with the same warning.



Home | Main Index | Thread Index | Old Index