[Bug 237068] /usr/local/bin/ld: BFD (GNU Binutils) 2.30 assertion fail elflink.c:2824

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon May 20 20:38:15 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237068

--- Comment #19 from Mark Millard <marklmi26-fbsd at yahoo.com> ---
(In reply to Mark Millard from comment #16)

The below is about alternate fixed_seed_override
definitions/declarations in the small example
(not llvm60) and the consequences, in particular
not getting the BFD_ASSERTs. They are not proposed
fixes: I'm just reporting what was important about
the fixed_seed_override definition that I used in
the small example.

Instead:

unsigned long fixed_seed_override= 0x0;
or:
extern unsigned long fixed_seed_override;

so they instead do not contribute to .data .

These change small_link_failure-1.0.so such that the
BFD_ASSERT messages are not produced. The "0xdeadc0de"
vs. other two end up as reported below.

The file offset changes from as seen in (note the matching
0x10cc8 vs. the symbol tables for the 0xdeadc0de based
example):
. . .
  [19] .data             PROGBITS         0000000000010ca8  00000ca8
       0000000000000020  0000000000000000  WA       0     0     8
  [20] .bss              NOBITS           0000000000010cc8  00000cc8
       0000000000000010  0000000000000000  WA       0     0     8
. . .
Symbol table (.dynsym) contains 16 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
     7: 0000000000010cc8     0 NOTYPE  GLOBAL DEFAULT   20
__bss_start@@LLVM_6.0 (2)
. . .
Symbol table (.symtab) contains 52 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
    43: 0000000000010cc8     0 NOTYPE  GLOBAL DEFAULT   20 __bss_start
. . .

to as seen in (note the 0x10cc0 vs. 0x10cb9's in the symbol tables):
. . .
  [19] .data             PROGBITS         0000000000010ca8  00000ca8
       0000000000000011  0000000000000000  WA       0     0     8
  [20] .bss              NOBITS           0000000000010cc0  00000cb9
       0000000000000018  0000000000000000  WA       0     0     8
. . .
Symbol table (.dynsym) contains 16 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
     7: 0000000000010cb9     0 NOTYPE  GLOBAL DEFAULT   20
__bss_start@@LLVM_6.0 (2)
. . .
Symbol table (.symtab) contains 52 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
    43: 0000000000010cb9     0 NOTYPE  GLOBAL DEFAULT   20 __bss_start
. . .

(Also note the odd .data size 0x11 compared to the earlier 0x20.)

So the definition of fixed_seed_override with a non-zero value
being involved is an important part of setting up the small
example of rejecting __bss_start@@LLVM_6.0 use internally.

(I had to discover this to make the small example C++ program.)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-toolchain mailing list