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

Re: [PATCH 2/6] Align all sections to 4KB


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Sat, 6 Jun 2026 17:02:13 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=yV120SJkaXOhDJ3ht7+zQUfjiEG91MP1CShsdkCq8DE=; fh=xSXpILpZGcC0b6sYdroUP2Mv8Ud1opSGb2BtbE0ZumE=; b=RTMlEsfLDS/AYJIMSfN9YsxPzufndqQRVcUse5Ds12JvkgDO8LWarBF379i8ai3EJW ps9qh6jbAzoW2swQAYo5K4Jgg0rWNnpd/oUYwKJ+uBXm6zenHJEJV7N3Jx0LRsYMtYvw iNnLhztVQcd9WYmvoKodHifHfiO76UqgJcoiL/jE0tlOk3KdfIDSMHdPcNTK3O2CVuth Vw8b+LIOUjOOULb4oHNqTCSaPTWl5mp/cJfGr+thb1snwN0jY7lTOWQcAf5NpgLq0v1E aghZOMiJmMM5I2KTZdLuIJ+Dupav6j9PPyJLn4GRxXQKL6+IybAjOrVgNtibxR0KNuRS 8wLg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1780761747; cv=none; d=google.com; s=arc-20240605; b=ZUwxPIR1wcE7PN6cteWYFt2Qrx3FvJ92lfVUuxe78TJJFakoNeUoKUoE/9g8LJIm39 CKx+TNf1ih3wM2Jhj3zRwcUHBzIvbTNYrrxdCWlJWkxuqm1RRSFsQHkrlOEKF91Jfs/W 4HN0c82tK0K9fEPRuFU4/4ZdSFaTogrYzaWJS+Lrb5FP5Gsy43MC78i9c5cgEL3K7IPX RWEd076cQUGYDbedXClSRKsj/yndMsUDLBznSbbuJ/C6VHfcwnClffX+uoGz8NDvoebo Cia1dvk6lxxGz5e1R2YHKez805nWthOjg7bCN3Mp2gTC1FmE9I0AaP9lugxXiIgWKeWT kqTA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: Frediano Ziglio <frediano.ziglio@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Sat, 06 Jun 2026 16:02:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Frediano

On Fri, 5 Jun 2026 at 08:45, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 04.06.2026 12:16, Frediano Ziglio wrote:
> > On Tue, 2 Jun 2026 at 13:09, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> >> On 29.05.2026 17:35, Frediano Ziglio wrote:
> >>> --- a/xen/arch/x86/xen.lds.S
> >>> +++ b/xen/arch/x86/xen.lds.S
> >>> @@ -162,8 +162,8 @@ SECTIONS
> >>>         __note_gnu_build_id_end = .;
> >>>    } PHDR(note) PHDR(text)
> >>>  #elif defined(BUILD_ID_EFI)
> >>> -  /* Workaround bug in binutils < 2.36 */
> >>> -  . = ALIGN(32);
> >>> +  /* align to satisfy UEFI CA memory mitigation */
> >>> +  . = ALIGN(PAGE_SIZE);
> >>>    DECL_SECTION(.buildid) {
> >>>         __note_gnu_build_id_start = .;
> >>>         *(.buildid)
> >>> @@ -330,6 +330,7 @@ SECTIONS
> >>>    __2M_rwdata_end = ALIGN(SECTION_ALIGN);
> >>>
> >>>  #ifdef EFI
> >>> +  . = ALIGN(PAGE_SIZE);
> >>>    .reloc ALIGN(4) : {
> >>>      __base_relocs_start = .;
> >>>      *(.reloc)
> >>> @@ -355,6 +356,7 @@ SECTIONS
> >>>    VIRT_START &= 0;
> >>>    ALT_START &= 0;
> >>>
> >>> +  . = ALIGN(PAGE_SIZE);
> >>>    .sbat (NOLOAD) : { *(.sbat) }
> >>>  #elif defined(XEN_BUILD_EFI)
> >>>    /*
> >>
> >> You say "all sections" in the title, yet this is not covering e.g. debug
> >> info.
> >
> > I will change to "all loadable sections". debug sections are not
> > loadable so they don't cause an issue.
>
> Please try to be precise there, as some aspects are subtle. As per my
> understanding, like .reloc all .debug_* are loadable (and may be loaded).
> The IMAGE_SCN_MEM_DISCARDABLE flag merely means they can be discarded at
> a certain point after image loading (for .reloc in particular: after
> relocations were processed).
>
> Jan

No, debug sections are not loadable, for instance, in a random
executable I found:

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .text         0000c7f8  0000000140001000  0000000140001000  00000600  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
  1 .data         00000250  000000014000e000  000000014000e000  0000ce00  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  2 .rdata        00002c70  000000014000f000  000000014000f000  0000d200  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .pdata        00000654  0000000140012000  0000000140012000  00010000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .xdata        00000630  0000000140013000  0000000140013000  00010800  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .bss          00001ec0  0000000140014000  0000000140014000  00000000  2**4
                  ALLOC
  6 .idata        00000c88  0000000140016000  0000000140016000  00011000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  7 .CRT          00000060  0000000140017000  0000000140017000  00011e00  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  8 .tls          00000010  0000000140018000  0000000140018000  00012000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .reloc        0000009c  0000000140019000  0000000140019000  00012200  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .debug_aranges 00000150  000000014001a000  000000014001a000  00012400  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_info   0000d5e4  000000014001b000  000000014001b000  00012600  2**0
                  CONTENTS, READONLY, DEBUGGING
 12 .debug_abbrev 000014de  0000000140029000  0000000140029000  0001fc00  2**0
                  CONTENTS, READONLY, DEBUGGING
 13 .debug_line   00001a36  000000014002b000  000000014002b000  00021200  2**0
                  CONTENTS, READONLY, DEBUGGING
 14 .debug_frame  00000f40  000000014002d000  000000014002d000  00022e00  2**0
                  CONTENTS, READONLY, DEBUGGING
 15 .debug_str    000003a0  000000014002e000  000000014002e000  00023e00  2**0
                  CONTENTS, READONLY, DEBUGGING
 16 .debug_line_str 00000a76  000000014002f000  000000014002f000  00024200  2**0
                  CONTENTS, READONLY, DEBUGGING
 17 .debug_loclists 0000174a  0000000140030000  0000000140030000  00024e00  2**0
                  CONTENTS, READONLY, DEBUGGING
 18 .debug_rnglists 0000039c  0000000140032000  0000000140032000  00026600  2**0
                  CONTENTS, READONLY, DEBUGGING

Maybe "loaded" instead of "loadable" ?

Frediano



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.