Merge pull request #17144 from Homebrew/dependabot/bundler/Library/Homebrew/patchelf-1.5.1
This commit is contained in:
commit
7b07e4d5a8
@ -40,7 +40,7 @@ GEM
|
||||
parser (3.3.0.5)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
patchelf (1.5.0)
|
||||
patchelf (1.5.1)
|
||||
elftools (>= 1.3)
|
||||
plist (3.7.1)
|
||||
prism (0.24.0)
|
||||
|
@ -65,7 +65,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rainbow-3.1.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.11353/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parlour-8.1.0/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.5.0/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.5.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.1/lib")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/arm64-darwin-20/#{Gem.extension_api_version}/prism-0.24.0")
|
||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/prism-0.24.0/lib")
|
||||
|
@ -451,10 +451,10 @@ module PatchELF
|
||||
|
||||
begin
|
||||
new_index = new_section_idx(old_shndx)
|
||||
next unless new_index
|
||||
rescue ArgumentError
|
||||
Logger.warn "entry #{entry} in symbol table refers to a non existing section, skipping"
|
||||
end
|
||||
next unless new_index
|
||||
|
||||
sym[pack[:st_shndx]] = new_index
|
||||
|
||||
@ -561,11 +561,12 @@ module PatchELF
|
||||
if needed_space > start_offset
|
||||
needed_space += seg_num_bytes # new load segment is required
|
||||
|
||||
needed_pages = Helper.alignup(needed_space - start_offset, page_size) / page_size
|
||||
extra_bytes = needed_space - start_offset
|
||||
needed_pages = Helper.alignup(extra_bytes, page_size) / page_size
|
||||
Logger.debug "needed pages is #{needed_pages}"
|
||||
raise PatchError, 'virtual address space underrun' if needed_pages * page_size > first_page
|
||||
|
||||
shift_file(needed_pages, start_offset)
|
||||
shift_file(needed_pages, start_offset, extra_bytes)
|
||||
|
||||
first_page -= needed_pages * page_size
|
||||
start_offset += needed_pages * page_size
|
||||
@ -776,7 +777,7 @@ module PatchELF
|
||||
end
|
||||
# rubocop:enable Metrics/PerceivedComplexity
|
||||
|
||||
def shift_file(extra_pages, start_offset)
|
||||
def shift_file(extra_pages, start_offset, extra_bytes)
|
||||
raise PatchError, "start_offset(#{start_offset}) < ehdr.num_bytes" if start_offset < ehdr.num_bytes
|
||||
|
||||
oldsz = @buffer.size
|
||||
@ -799,8 +800,8 @@ module PatchELF
|
||||
p_offset: split_phdr.p_offset - split_shift - shift,
|
||||
p_vaddr: split_phdr.p_vaddr - split_shift - shift,
|
||||
p_paddr: split_phdr.p_paddr - split_shift - shift,
|
||||
p_filesz: split_shift + shift,
|
||||
p_memsz: split_shift + shift,
|
||||
p_filesz: split_shift + extra_bytes,
|
||||
p_memsz: split_shift + extra_bytes,
|
||||
p_flags: ELFTools::Constants::PF_R | ELFTools::Constants::PF_W,
|
||||
p_align: page_size
|
||||
)
|
@ -2,5 +2,5 @@
|
||||
|
||||
module PatchELF
|
||||
# Current gem version.
|
||||
VERSION = '1.5.0'.freeze
|
||||
VERSION = '1.5.1'.freeze
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user