bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/14993] New: Section sorting interferes with the incremental up


From: hjl.tools at gmail dot com
Subject: [Bug gold/14993] New: Section sorting interferes with the incremental update
Date: Thu, 03 Jan 2013 18:41:17 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14993

             Bug #: 14993
           Summary: Section sorting interferes with the incremental update
           Product: binutils
           Version: 2.24 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified


On Linux/x32, I got

`echo g++ -mx32  -W -Wall    -Werror -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -fmerge-constants   -static-libstdc++
-static-libgcc  -o incremental_test_2 | sed -e
's/-Wp,-D_FORTIFY_SOURCE=[0-9][0-9]*//'` -Wl,--incremental-update
-Bgcctestdir/ two_file_test_tmp_2.o two_file_test_1b_ndebug.o
two_file_test_2_ndebug.o two_file_test_main_ndebug.o
gcctestdir/ld: internal error in convert_types, at
/export/gnu/import/git/binutils/gold/gold.h:192
collect2: error: ld returned 1 exit status
make[3]: *** [incremental_test_2] Error 1

(gdb) bt
#0  gold::do_gold_unreachable (
    filename=0x8367b0 "/export/gnu/import/git/binutils/gold/gold.h",
    lineno=192,
    function=0x83781b <unsigned int gold::convert_types<unsigned int,
unsigned long long>(unsigned long long)::__FUNCTION__>
"convert_types")
    at /export/gnu/import/git/binutils/gold/gold.cc:102
#1  0x0043f4d4 in gold::convert_types<unsigned int, unsigned long long> (
    from=18446744073709551050)
    at /export/gnu/import/git/binutils/gold/gold.h:192
#2  0x004e4eb1 in gold::Sized_relobj<32, false>::do_set_section_offset (
    this=0xc83160, shndx=7, off=18446744073709551050)
    at /export/gnu/import/git/binutils/gold/object.h:1937
#3  0x004d95af in gold::Relobj::set_section_offset (this=0xc83160, shndx=7,
    off=18446744073709551050)
    at /export/gnu/import/git/binutils/gold/object.h:1172
#4  0x00680bdb in
gold::Output_section::Input_section::set_address_and_file_offset
(this=0xffff8a90, address=4195370, file_offset=250,
section_file_offset=816)
    at /export/gnu/import/git/binutils/gold/output.cc:2156
#5  0x00690eec in gold::Output_section::add_input_section<32, false> (
    this=0xc5f350, layout=0xffff9670, object=0xc83160, shndx=7,
    secname=0xf7ff867e ".text._Z4f13iv", shdr=..., reloc_shndx=0,
    have_sections_script=false)
    at /export/gnu/import/git/binutils/gold/output.cc:2514
---Type <return> to continue, or q <return> to quit---
#6  0x0061ed1c in gold::Layout::layout<32, false> (this=0xffff9670,
    object=0xc83160, shndx=7, name=0xf7ff867e ".text._Z4f13iv", shdr=...,
    reloc_shndx=0, off=0xffff8c80)
    at /export/gnu/import/git/binutils/gold/layout.cc:1177
#7  0x0063987d in gold::Sized_relobj_file<32, false>::layout_section (
    this=0xc83160, layout=0xffff9670, shndx=7,
    name=0xf7ff867e ".text._Z4f13iv", shdr=..., reloc_shndx=0, reloc_type=0)
    at /export/gnu/import/git/binutils/gold/object.cc:1161
#8  0x00636065 in gold::Sized_relobj_file<32, false>::do_layout (
    this=0xc83160, symtab=0xffff94f0, layout=0xffff9670, sd=0xc61ad0)
    at /export/gnu/import/git/binutils/gold/object.cc:1665

#9  0x00578ab9 in gold::Object::layout (this=0xc83160, symtab=0xffff94f0,
    layout=0xffff9670, sd=0xc61ad0)
    at /export/gnu/import/git/binutils/gold/object.h:570
#10 0x006e641c in gold::Add_symbols::run (this=0xc83440)
    at /export/gnu/import/git/binutils/gold/readsyms.cc:634
#11 0x0076d0c7 in gold::Workqueue::find_and_run_task (this=0xffff92d0,
    thread_number=0) at /export/gnu/import/git/binutils/gold/workqueue.cc:319
#12 0x0076d713 in gold::Workqueue::process (this=0xffff92d0, thread_number=0)
    at /export/gnu/import/git/binutils/gold/workqueue.cc:495
#13 0x0040347a in main (argc=37, argv=0xffffcbb4)

A section offset (18446744073709551050 == 0xFFFFFFFFFFFFFDCA == -3530)
that doesn't fit in a 32-bit Address.  This offset is also invalid for
64-bit.  But it is overridden by

  off_t offset;
  Output_section* os = layout->layout(this, shndx, name, shdr,
                                          reloc_shndx, reloc_type, &offset);

  this->output_sections()[shndx] = os;
  if (offset == -1)
    this->section_offsets()[shndx] = invalid_address;
  else   
    this->section_offsets()[shndx] = convert_types<Address, off_t>(offset);

(gdb) bt
#0  gold::Sized_relobj_file<64, false>::layout_section (this=0xd83720, 
    layout=0x7fffffff7c80, shndx=7, name=0x7ffff1b6e69e ".text._Z4f13iv", 
    shdr=..., reloc_shndx=0, reloc_type=0)
    at /export/gnu/import/git/binutils/gold/object.cc:1172
#1  0x00000000006281b7 in gold::Sized_relobj_file<64, false>::do_layout (
    this=0xd83720, symtab=0x7fffffff7a20, layout=0x7fffffff7c80, sd=0xc958d0)
    at /export/gnu/import/git/binutils/gold/object.cc:1665
#2  0x00000000005658a8 in gold::Object::layout (this=0xd83720, 
    symtab=0x7fffffff7a20, layout=0x7fffffff7c80, sd=0xc958d0)
    at /export/gnu/import/git/binutils/gold/object.h:570
#3  0x00000000006bf8af in gold::Add_symbols::run (this=0xd83bb0)
    at /export/gnu/import/git/binutils/gold/readsyms.cc:634
#4  0x0000000000742086 in gold::Workqueue::find_and_run_task (
    this=0x7fffffff76d0, thread_number=0)
    at /export/gnu/import/git/binutils/gold/workqueue.cc:319
#5  0x00000000007426d0 in gold::Workqueue::process (this=0x7fffffff76d0, 
    thread_number=0) at /export/gnu/import/git/binutils/gold/workqueue.cc:495
#6  0x0000000000404402 in main (argc=36, argv=0x7fffffffda18)
    at /export/gnu/import/git/binutils/gold/main.cc:252

The offset set by Input_section::set_address_and_file_offset is
ignored.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]