glibc 2.36 *.o files debug extraction broken

Jakub Bogusz qboosh at pld-linux.org
Tue Aug 16 20:31:18 CEST 2022


In glibc 2.36 build debuginfo extraction process removes .note.GNU-stack
section:

(before installing)
$ objdump -h ../BUILD/glibc-2.36.debuginfo/builddir/csu/crtn.o

../BUILD/glibc-2.36.debuginfo/builddir/csu/crtn.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  00000000  00000000  00000034  2**0
                  ALLOC
  3 .note.gnu.property 00000044  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .init         00000005  00000000  00000000  00000078  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  5 .fini         00000005  00000000  00000000  0000007d  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .note.GNU-stack 00000000  00000000  00000000  00000082  2**0
                  CONTENTS, READONLY
  7 .debug_line   0000005a  00000000  00000000  00000084  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
  8 .debug_info   00000022  00000000  00000000  000000d9  2**0
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
  9 .debug_abbrev 00000012  00000000  00000000  000000fb  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 10 .debug_aranges 00000028  00000000  00000000  00000110  2**3
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS
 11 .debug_str    0000004f  00000000  00000000  00000133  2**0
                  CONTENTS, READONLY, DEBUGGING, OCTETS
 12 .debug_ranges 00000020  00000000  00000000  00000184  2**3
                  CONTENTS, RELOC, READONLY, DEBUGGING, OCTETS

(after)
/home/users/qboosh/tmp/glibc-2.36-i686-root-qboosh.debuginfo/usr/lib/crtn.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  00000000  00000000  00000034  2**0
                  ALLOC
  3 .note.gnu.property 00000044  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .init         00000005  00000000  00000000  00000078  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  5 .fini         00000005  00000000  00000000  0000007d  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .gnu_debuglink 00000020  00000000  00000000  00000084  2**2
                  CONTENTS, READONLY


With debuginfo packages disabled, .note.GNU-stack section is still present.

It results in binaries executable stack and linker features misdetection
due to new warning:

/usr/bin/ld: warning: /usr/lib/gcc/i686-pld-linux/11.3.0/../../../crtn.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

affecting e.g. gjs:

Compiler for C++ supports link arguments -Bsymbolic-functions: NO

meson.build:78:12: ERROR: Problem encountered: -Bsymbolic-functions not supported, configure with
-Dbsymbolic_functions=false

or gcab:
Compiler for C supports link arguments -Wl,-z,relro: NO
Compiler for C supports link arguments -Wl,-z,now: NO
+ missing symbol versioning

For now only i686 builds are affected because x86_64 and x32 glibc-devel packages
haven't been updated on builders.


Any guesses what changed?


-- 
Jakub Bogusz    http://qboosh.pl/


More information about the pld-devel-en mailing list