summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-07-25 17:48:01 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-07-25 17:48:01 -0700
commit42c6da48052fc2da381a2e7bca148e17999c168e (patch)
tree20a0e409741ff46fcbc458a399286619ee711798
parentf1ad6320410eb6d6c0ff6b1684a92dad41733ec3 (diff)
parent19709f3b37c230a6b59302d68e26da010ae0d217 (diff)
downloadelfcopy-42c6da48052fc2da381a2e7bca148e17999c168e.tar.gz
Merge korg/donut into korg/master
-rw-r--r--dwarf.c13
-rw-r--r--elfcopy.c20
2 files changed, 20 insertions, 13 deletions
diff --git a/dwarf.c b/dwarf.c
index 33d7469..4092596 100644
--- a/dwarf.c
+++ b/dwarf.c
@@ -2506,14 +2506,16 @@ display_debug_loc (struct dwarf_section *section, void *file)
seen_first_offset = 1;
else
{
- if (start < next)
- warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
+ if (start < next) {
+/* warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
(long)(start - section_begin), (long)(next - section_begin));
- else if (start > next) {
+*/
+ } else if (start > next) {
last_overlap = start;
- warn (_("There is an overlap of %ld bytes [0x%lx - 0x%lx] in .debug_loc section.\n"),
+/* warn (_("There is an overlap of %ld bytes [0x%lx - 0x%lx] in .debug_loc section.\n"),
(long)(start - next),
(long)(start - section_begin), (long)(next - section_begin));
+*/
}
}
start = next;
@@ -2864,7 +2866,7 @@ display_debug_ranges (struct dwarf_section *section,
seen_first_offset = 1;
else
{
- if (start < next)
+/* if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in %s section.\n"),
(long)(start - section_begin),
(long)(next - section_begin), section->name);
@@ -2872,6 +2874,7 @@ display_debug_ranges (struct dwarf_section *section,
warn (_("There is an overlap [0x%lx - 0x%lx] in %s section.\n"),
(long)(start - section_begin),
(long)(next - section_begin), section->name);
+*/
}
start = next;
diff --git a/elfcopy.c b/elfcopy.c
index 03c9154..1a32a59 100644
--- a/elfcopy.c
+++ b/elfcopy.c
@@ -107,7 +107,7 @@ verify_elf(GElf_Ehdr *ehdr, struct shdr_info_t *shdr_info, int shdr_info_len,
#endif
void adjust_elf(Elf *elf, const char *elf_name,
- Elf *newelf, const char *newelf_name,
+ Elf *newelf, const char *newelf_name __attribute__((unused)),
Ebl *ebl,
GElf_Ehdr *ehdr, /* store ELF header of original library */
bool *sym_filter, int num_symbols,
@@ -1044,7 +1044,7 @@ void adjust_elf(Elf *elf, const char *elf_name,
/* Go over the section array and find which section's offset
field matches this program header's, and update the program
- header's offset to refelect the new value.
+ header's offset to reflect the new value.
*/
Elf64_Off file_end, mem_end;
Elf64_Off new_phdr_offset =
@@ -1053,6 +1053,13 @@ void adjust_elf(Elf *elf, const char *elf_name,
&file_end,
&mem_end);
+ if (new_phdr_offset == (Elf64_Off)-1) {
+ INFO("PT_ header type: %d does not contain any sections.\n",
+ phdr_info[pi].p_type);
+ /* Move to the next program header. */
+ continue;
+ }
+
/* Alignments of 0 and 1 mean nothing. Higher alignments are
interpreted as powers of 2. */
if (phdr_info[pi].p_align > 1) {
@@ -1411,7 +1418,7 @@ static void update_relocations_section_symbol_references(
d->d_size = new_nrels * relsect_info->shdr.sh_entsize;
}
-static void update_relocations_section_offsets(Elf *newelf, Elf *elf __attribute((unused)),
+static void update_relocations_section_offsets(Elf *newelf __attribute((unused)), Elf *elf,
Ebl *ebl __attribute__((unused)),
shdr_info_t *info,
int info_len __attribute__((unused)),
@@ -1886,7 +1893,7 @@ static void print_dynamic_segment_strings(Elf *elf, Ebl *oldebl,
#endif
static void adjust_dynamic_segment_offsets(Elf *elf, Ebl *oldebl,
- Elf *newelf,
+ Elf *newelf __attribute__((unused)),
int dynidx, /* index of .dynamic section in shdr_info[] */
shdr_info_t *shdr_info,
int shdr_info_len)
@@ -2439,10 +2446,7 @@ update_symbol_values(Elf *elf, GElf_Ehdr *ehdr,
sym->st_value + vaddr_delta,
vaddr_delta);
else {
- INFO("(value is zero, not adjusting it)",
- sym->st_value,
- sym->st_value + vaddr_delta,
- vaddr_delta);
+ INFO("(value is zero, not adjusting it)");
/* This might be a bit too paranoid, but symbols with values of
zero for which we are not adjusting the value must be in the
static-symbol section and refer to a section which is