[LLVMbugs] [Bug 22463] New: Can emit SHF_MERGE section with a sh_entsize of 0

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 4 12:35:04 PST 2015


            Bug ID: 22463
           Summary: Can emit SHF_MERGE section with a sh_entsize of 0
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: peter at pcc.me.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Given the following IR:

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

$foo = comdat any
@foo = unnamed_addr constant [4 x i32] [i32 7, i32 8, i32 9, i32 10], comdat

define [4 x i32]* @f() {
  ret [4 x i32]* @foo

we can emit a SHF_MERGE section with a sh_entsize of 0. This is invalid and can
cause some versions of gold to crash.

$ ~/src/llvm-build-rel/bin/llc -filetype=obj -o foo.o foo.ll
$ readelf -a -W foo.o | grep rodata.foo
  [ 6] .rodata.foo       PROGBITS        0000000000000000 000058 000010 00 AMG 
0   0  4
$ ld.gold -r -o foo2.o foo.o
Floating point exception (core dumped)

(binutils bug fix: https://sourceware.org/ml/binutils/2015-02/msg00040.html)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150204/a48ef11b/attachment.html>

More information about the llvm-bugs mailing list