LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 43241 - Regression(370635): " section '.text' cannot be removed because it is referenced by the section '.ARM.exidx'" when using llvm-objcopy --extract-partition
Summary: Regression(370635): " section '.text' cannot be removed because it is referen...
Status: RESOLVED FIXED
Alias: None
Product: lld
Classification: Unclassified
Component: ELF (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-06 06:21 PDT by Nico Weber
Modified: 2019-09-06 09:00 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Weber 2019-09-06 06:21:07 PDT
Grab --reproduce output: https://drive.google.com/file/d/1m5fCTdnonSqdznHNrhmhtlnPXIVDk3q8/view?usp=sharing (~600MB gzip)

This produces lib.unstripped/libchrome__combined.so which is then fed into llvm-objcopy like so: ` ../../../../llvm-project/out/gn/bin/llvm-objcopy --extract-partition libvr.so lib.unstripped/libchrome__combined.so`. That errors out after r370635:

$ ../../../../llvm-project/out/gn/bin/llvm-objcopy --extract-partition libvr.so lib.unstripped/libchrome__combined.so
../../../../llvm-project/out/gn/bin/llvm-objcopy: error: 'lib.unstripped/libchrome__combined.so': section '.text' cannot be removed because it is referenced by the section '.ARM.exidx'


(Originally at https://crbug.com/1000647)
Comment 1 Nico Weber 2019-09-06 06:24:07 PDT
I reverted the offending change for now while we figure out what's going on.

$ llvm/utils/git-svn/git-llvm push 
Pushing 1 monorepo commit:
  acdab684384 Revert r370635, it caused PR43241.
Sending        lld/trunk/ELF/Driver.cpp
Sending        lld/trunk/ELF/ICF.cpp
Sending        lld/trunk/ELF/LinkerScript.cpp
Sending        lld/trunk/ELF/LinkerScript.h
Sending        lld/trunk/ELF/Writer.cpp
Sending        lld/trunk/ELF/Writer.h
Sending        lld/trunk/test/ELF/linkerscript/early-assign-symbol.s
Deleting       lld/trunk/test/ELF/linkerscript/icf-output-sections.s
Sending        lld/trunk/test/ELF/linkerscript/subalign.s
Transmitting file data ........done
Committing transaction...
Committed revision 371202.
Committed acdab684384 to svn.
Comment 2 Fangrui Song 2019-09-06 09:00:08 PDT
Fixed by r371216

partitions + --icf=all + .ARM.exidx (sh_link pointing to .text)
This is an under-tested area...