bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/25138] New: Incorrect subtraction in linker script


From: saagar at saagarjha dot com
Subject: [Bug binutils/25138] New: Incorrect subtraction in linker script
Date: Mon, 28 Oct 2019 01:20:53 +0000

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

            Bug ID: 25138
           Summary: Incorrect subtraction in linker script
           Product: binutils
           Version: 2.33
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: saagar at saagarjha dot com
  Target Milestone: ---

I have a convoluted build process that uses a linker script that has started
giving me seemingly incorrect results in 2.33.1 (it worked as I expected in
2.31.1). Specifically, this part of the script:

    _nvram_data = .;

    /* NVM data (ex-filesystem) */
    *(.bss.N_* .rodata.N_*)

    . = ALIGN(PAGE_SIZE);
    _install_parameters = .;
    PROVIDE(N_install_parameters = .);
    _envram = .;
    _nvram_data_size = _envram - _nvram_data;

Used to (with 2.31.1) produce this:

                0x00000000c0d02100                _nvram_data = .
 *(.bss.N_* .rodata.N_*)
                0x00000000c0d02100                . = ALIGN (PAGE_SIZE)
                0x00000000c0d02100                _install_parameters = .
                [!provide]                        PROVIDE (N_install_parameters
= .)
                0x00000000c0d02100                _envram = .
                0x0000000000000000                _nvram_data_size = (_envram -
_nvram_data)

but it now produces this:

                0x00000000c0d02100                _nvram_data = .
 *(.bss.N_* .rodata.N_*)
                0x00000000c0d02100                . = ALIGN (PAGE_SIZE)
                0x00000000c0d02100                _install_parameters = .
                [!provide]                        PROVIDE (N_install_parameters
= .)
                0x00000000c0d02100                _envram = .
                0x00000000c0d00000                _nvram_data_size = (_envram -
_nvram_data)

(Note the difference in _nvram_data_size.) I think I've managed to figure out
that the change is due to this commit:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blobdiff;f=ld/ldexp.c;h=60b17ef5764a2a0bcc6fed82e420f91ad0b60441;hp=a8b833a6bb89aa54fd36c96ed2be1258f64fab74;hb=6a84624340dd19ccd927d91d79e0ece135c6d846;hpb=e044973b0cadb4c36c2a2c11e908d758b8cd75f9
which apparently went in as a fix for this bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=24008 but I'm not sure how that
would affect this…

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]