[PATCH] D58960: [llvm-objcopy] - Fix --compress-debug-sections when there are relocations.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 04:34:58 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, jakehehrlich, alexshap.
Herald added subscribers: jdoerfert, MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: rupprecht.

When --compress-debug-sections is given,
llvm-objcopy removes the uncompressed sections and adds compressed to the section list.
This makes all the pointers to old sections to be outdated.

Currently, code already has logic for replacing the target sections of the relocation
sections. But we also have to update the relocations by themselves.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40885.


https://reviews.llvm.org/D58960

Files:
  test/tools/llvm-objcopy/ELF/compress-debug-sections-relocations.test
  tools/llvm-objcopy/ELF/ELFObjcopy.cpp
  tools/llvm-objcopy/ELF/Object.cpp
  tools/llvm-objcopy/ELF/Object.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58960.189300.patch
Type: text/x-patch
Size: 6468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190305/5254a571/attachment.bin>


More information about the llvm-commits mailing list