From owner-freebsd-bugs@freebsd.org Fri Feb 9 00:05:52 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48D80F11D13 for ; Fri, 9 Feb 2018 00:05:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8D3086AC6 for ; Fri, 9 Feb 2018 00:05:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 22F1915204 for ; Fri, 9 Feb 2018 00:05:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w1905p1W010695 for ; Fri, 9 Feb 2018 00:05:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w1905pZU010685 for freebsd-bugs@FreeBSD.org; Fri, 9 Feb 2018 00:05:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 225775] btxld does not handle input with other than 2 PT_LOAD segments Date: Fri, 09 Feb 2018 00:05:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2018 00:05:52 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225775 --- Comment #2 from Ed Maste --- It is because lld collects read-only contents into a separate segment, for example: % readelf -l zfsloader.sym Elf file type is EXEC (Executable file) Entry point 0x0 There are 5 program headers, starting at offset 52 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x001000 0x00000000 0x00000000 0x58694 0x58694 R E 0x1000 LOAD 0x05a000 0x00059000 0x00059000 0x0afcc 0x0afcc R 0x1000 LOAD 0x065000 0x00064000 0x00064000 0x07854 0x14c9c RW 0x1000 GNU_RELRO 0x06c000 0x0006b000 0x0006b000 0x00854 0x01000 R 0x1 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0 Section to Segment mapping: Segment Sections... 00 .text .gnu_debuglink .comment .debug_str .debug_loc .debug_abbrev .debug_info .debug_ranges .debug_macinfo .debug_pubnames .debug_pubtypes .debug_frame .debug_line .debug_aranges .symtab .shstrtab .strtab=20 01 .rodata set_Xcommand_set=20 02 .data set_Xficl_compile_set .data.rel.ro .got .bss=20 03 .data.rel.ro .got=20 04=20=20=20=20=20 Linking with -z norelro leaves the three PT_LOADs, just the PT_GNU_RELRO is= not emitted. From the output above btxld should coalesce two PT_LOADs, and discarding a PT_LOAD should be an error not a warning. --=20 You are receiving this mail because: You are the assignee for the bug.=