[Nasm-bugs] [Bug 3392631] nasm generates broken .debug_loc section on ELF32

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Tue Mar 16 04:16:38 PDT 2021


https://bugzilla.nasm.us/show_bug.cgi?id=3392631

mliska at suse.cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mliska at suse.cz

--- Comment #3 from mliska at suse.cz ---
(In reply to Chang S. Bae from comment #1)
> It looks like a (partial) regression from this:
> 
> commit b2004511dddeefd7c0866a33ceaa5fa1a6ee0510
> Author: H. Peter Anvin <hpa at zytor.com>
> Date:   Tue Feb 26 00:02:35 2019 -0800
> 
>     ELF: handle more than 32,633 sections
> 
> But this change seems to be a part of huge changes.
> 
> 
> Another observation is
> 
>   Previously, before the commit, NASM generated an image with .debug_loc:
> 
>     .debug_loc contents:
>     0x00000000: 
> 
>     0x00000008: 
> 
>   With the proposed change, it produces this:
> 
>     .debug_loc contents:
>     0x00000000: 
> 
> Since the cdef_sse.asm is huge, I'm not sure which one is correct. Anyone
> can confirm this?

I can confirm that! I have a simple reproducer:

$ cat cdef.asm
%define ARCH_X86_64 1
%ifndef public_prefix
%endif
%define WIN64  0
%if WIN64 ; Windows x64 ;=================================================
    %if vzeroupper_required
    %endif
%endif
%macro BRANCH_INSTR 0-*
%endmacro
%if ARCH_X86_64
%macro DUP4 1-*
%endmacro
    ret
%endif ; ARCH_X86_64

$ nasm -o cdef.o -f elf64 -F dwarf cdef.asm
$ readelf -SW cdef.o
...
Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
  [11] .debug_loc        PROGBITS        0000000000000000 0005c0 000000 00     
0   0  1

So the section is really empty.

@hpa: Can you please take a look?

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


More information about the Nasm-bugs mailing list