Skip to content

Commit

Permalink
Merge branch 'release-0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
acolomb committed Jul 22, 2015
2 parents 864d64f + 3c3fd9d commit 96de54f
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ Doxyfile
# Compilation output
*.o
*.Po
*.lo
*.la
*.a
/doxygen
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2015-07-22 André Colomb <[email protected]>

* Fix README.md syntax compatibility for GitHub and include it in
the distribution.
* Fix bugs related to the handling of text / binary file modes on
Windows.
* Update included libcintelhex reference to benefit from bug fixes
there, some also related to binary file handling on Windows.
* Fix some localization issues (non-translatable strings, missing
newline).
* Add a TODO list with ideas for future development.
* Install documentation files: README, TODO, LICENSE, ChangeLog
* Update German translation.

* Release version 0.4.1

2015-04-09 André Colomb <[email protected]>

* Rework the build system, fixing several usage and portability
Expand Down
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = ./config.rpath
EXTRA_DIST += m4/gnulib-cache.m4
EXTRA_DIST += README.md LICENSE.txt TODO.md

doc_DATA = README.md LICENSE.txt TODO.md ChangeLog
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Compilers and linkers do a great job in generating machine-readable
binary code to be run on a CPU or embedded microprocessor. After
these tools have finished their job, sometimes it is necessary to
alter some bits of information inside these binary files. The most
common modern executable file format (at least in the *NIX world) is
**ELF**, the _E_xecutable and _L_inkable _F_ormat.
common modern executable file format (at least in the UNIX / Linux
world) is **ELF**, the Executable and Linkable Format.

The *elf-mangle* tool exists to examine and alter (thus *mangle*)
these ELF executable and binary data images, for example when you need
Expand Down
40 changes: 40 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Issues list for elf-mangle
==========================

## String search without ELF map ##

The `--strings` option should be usable without an ELF symbol map,
e.g. to find which one needs to be used.

Factor out an `idc-strings` utility for supported image file formats.


## Override data from binary files ##

Symbol override data must be passed as hex bytes on the command line.

Support reading the from a binary file instead.


## Additional image formats ##

Support for input / output blobs:

* SREC
* Sparse output with IHEX / SREC, skipping uninitialized data:

# Generate blob with only the specified override fields
elf-mangle in.elf -o out.bin --sparse -D field=123456


## Missing man page ##

Can this be extracted from the README Markdown?


## Diagnostic messages ##

* No more `fprintf(stderr, ...)`.
* Rework `#ifdef DEBUG` blocks to use `if (DEBUG)` and rely on
optimizer.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# <http://www.gnu.org/licenses/>.


AC_INIT([elf-mangle], [0.4], [[email protected]])
AC_INIT([elf-mangle], [0.4.1], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/elf-mangle.c])
AC_CONFIG_AUX_DIR([.])
Expand Down
13 changes: 13 additions & 0 deletions gnulib/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/.deps
/.libs
/alloca.c
/alloca.h
/alloca.in.h
/arg-nonnull.h
/argp-ba.c
/argp-eexst.c
/argp-fmtstream.c
Expand All @@ -15,6 +19,7 @@
/argp-xinl.c
/asnprintf.c
/basename-lgpl.c
/c++defs.h
/dirname.h
/dirname-lgpl.c
/dosname.h
Expand All @@ -24,6 +29,7 @@
/float.in.h
/getopt1.c
/getopt.c
/getopt.h
/getopt.in.h
/getopt_int.h
/getsubopt.c
Expand All @@ -47,28 +53,35 @@
/stdbool.in.h
/stddef.in.h
/stdint.in.h
/stdio.h
/stdio.in.h
/stdlib.h
/stdlib.in.h
/strcasecmp.c
/strchrnul.c
/strchrnul.valgrind
/strerror.c
/strerror-override.c
/strerror-override.h
/string.h
/string.in.h
/strings.h
/strings.in.h
/stripslash.c
/strncasecmp.c
/strndup.c
/strnlen.c
/sysexits.in.h
/sys/types.h
/sys_types.in.h
/unistd.c
/unistd.h
/unistd.in.h
/vasnprintf.c
/vasnprintf.h
/verify.h
/vsnprintf.c
/warn-on-use.h
/wchar.in.h
/xsize.c
/xsize.h
2 changes: 1 addition & 1 deletion libcintelhex
68 changes: 49 additions & 19 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: elf-mangle 0.1\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2015-04-09 14:08+0200\n"
"PO-Revision-Date: 2015-04-09 14:03+0100\n"
"POT-Creation-Date: 2015-07-22 12:55+0200\n"
"PO-Revision-Date: 2015-07-22 12:56+0100\n"
"Last-Translator: Andre Colomb <[email protected]>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 1.7.5\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"

Expand Down Expand Up @@ -122,12 +122,17 @@ msgstr ""
msgid "Invalid input image file format.\n"
msgstr "Ungültiges Format für Binärabbild.\n"

#: src/image_formats.c:83
#, c-format
msgid "%s: Output file \"%s\" format %d\n"
msgstr "%s: Ausgabedatei \"%s\" im Format %d\n"

#: src/image_formats.c:95
#, c-format
msgid "Invalid output image file format specified.\n"
msgstr "Ungültiges Ausgabeformat für Binärabbild.\n"

#: src/image_ihex_input.c:77 src/image_raw.c:168 src/image_raw.c:216
#: src/image_ihex_input.c:77 src/image_raw.c:173 src/image_raw.c:222
#, c-format
msgid "Cannot open image \"%s\" (%s)\n"
msgstr "Abbilddatei \"%s\" kann nicht geöffnet werden (%s)\n"
Expand All @@ -138,12 +143,17 @@ msgid "Could not determine data range in Intel Hex file \"%s\" (%s)\n"
msgstr ""
"Konnte Datenbereich in der Intel-Hex-Datei \"%s\" nicht ermitteln (%s)\n"

#: src/image_ihex_input.c:86 src/image_raw.c:173
#: src/image_ihex_input.c:86 src/image_raw.c:178
#, c-format
msgid "Image file \"%s\" is empty\n"
msgstr "Abbilddatei \"%s\" ist leer\n"

#: src/image_ihex_input.c:91 src/image_raw.c:176
#: src/image_ihex_input.c:88
#, c-format
msgid "%s: %s contains range 0x%04<PRIx32> to 0x%04<PRIx32>\n"
msgstr "%s: %s umfasst den Bereich 0x%04<PRIx32> bis 0x%04<PRIx32>\n"

#: src/image_ihex_input.c:91 src/image_raw.c:181
#, c-format
msgid "Image file \"%s\" is too small, %zu of %zu bytes missing\n"
msgstr "Abbilddatei \"%s\" ist zu klein, %zu von %zu Byte fehlen\n"
Expand All @@ -153,28 +163,38 @@ msgstr "Abbilddatei \"%s\" ist zu klein, %zu von %zu Byte fehlen\n"
msgid "Could not copy data from Intel Hex file \"%s\" (%s)\n"
msgstr "Konnte keine Daten aus der Intel-Hex-Datei \"%s\" kopieren (%s)\n"

#: src/image_ihex_output.c:104
#, c-format
msgid "%s: Record len=%zu source=%p rest=%zu USBA=%<PRIu32>\n"
msgstr "%s: Eintrag len=%zu source=%p rest=%zu USBA=%<PRIu32>\n"

#: src/image_ihex_output.c:145
#, c-format
msgid "Cannot open output image \"%s\" (%s)\n"
msgstr "Abbilddatei \"%s\" für Ausgabe kann nicht geöffnet werden (%s)\n"

#: src/image_raw.c:105
#: src/image_raw.c:110
#, c-format
msgid "%s: copy %zu bytes from file offset %zu to %p\n"
msgstr "%s: Kopiere %zu Byte von Dateiposition %zu nach %p\n"

#: src/image_raw.c:115
#: src/image_raw.c:120
#, c-format
msgid "Failed to read %s (%zu bytes) from file offset %zu to %p (%s)\n"
msgstr ""
"Fehler beim Lesen von %s (%zu Byte) von Dateiposition %zu nach %p (%s)\n"

#: src/image_raw.c:219
#: src/image_raw.c:190
#, c-format
msgid "%s: mmap() failed (%s)\n"
msgstr "%s: mmap() fehlgeschlagen (%s)\n"

#: src/image_raw.c:225
#, c-format
msgid "Cannot resize image file \"%s\" to %zu bytes (%s)\n"
msgstr "Abbilddatei \"%s\" kann nicht auf %zu Bytes vergrößert werden (%s)\n"

#: src/image_raw.c:227
#: src/image_raw.c:233
#, c-format
msgid "Cannot write image file \"%s\" (%s)\n"
msgstr "Abbilddatei \"%s\" kann nicht geschrieben werden (%s)\n"
Expand Down Expand Up @@ -362,46 +382,46 @@ msgstr "Feld nicht gefunden"
msgid "Unable to parse override `%.*s' (%s)\n"
msgstr "Kann Zuweisung '%.*s' nicht parsen (%s)\n"

#: src/symbol_map.c:92
#: src/symbol_map.c:91
#, c-format
msgid "Could not access section header string table: %s\n"
msgstr "Kann nicht auf Sektions-Header-Stringtabelle zugreifen: %s\n"

#: src/symbol_map.c:101
#: src/symbol_map.c:100
#, c-format
msgid "%s: [%zu] %s\n"
msgstr "%s: [%zu] %s\n"

#: src/symbol_map.c:113
#: src/symbol_map.c:112
#, c-format
msgid "Header of ELF section %zu inaccessible: %s\n"
msgstr "Header der ELF-Sektion %zu unlesbar: %s\n"

#: src/symbol_map.c:117
#: src/symbol_map.c:116
#, c-format
msgid "No ELF symbol table found\n"
msgstr "Keine ELF-Symboltabelle gefunden\n"

#: src/symbol_map.c:118
#: src/symbol_map.c:117
#, c-format
msgid "No ELF section named '%s' found\n"
msgstr "Keine ELF-Sektion namens '%s' gefunden\n"

#: src/symbol_map.c:136
#: src/symbol_map.c:135
#, c-format
msgid "Could not allocate image data: %s\n"
msgstr "Konnte keinen Speicher für Abbilddaten zuweisen: %s\n"

#: src/symbol_map.c:235
#: src/symbol_map.c:234
msgid "Not an ELF object"
msgstr "Kein ELF-Objekt"

#: src/symbol_map.c:244
#: src/symbol_map.c:243
#, c-format
msgid "Cannot open symbol map \"%s\" (%s)\n"
msgstr "Symbolzuordnung \"%s\" kann nicht geöffnet werden (%s)\n"

#: src/symbol_map.c:295
#: src/symbol_map.c:294
#, c-format
msgid "Section image size: %zu bytes\n"
msgstr "Größe der Sektion: %zu Byte\n"
Expand All @@ -415,3 +435,13 @@ msgstr "%s: Ziel '%s' (%p) entspricht Symbol %p in Quelle\n"
#, c-format
msgid "%s: %zu of %zu bytes copied\n"
msgstr "%s: %zu von %zu Byte kopiert\n"

#: src/transform.c:73
#, c-format
msgid "Target map field %s not found in source.\n"
msgstr "Feld %s der Zielzuordnung nicht in der Quelle gefunden.\n"

#: src/transform.c:90
#, c-format
msgid "%s: Copy %d symbols in to %d out\n"
msgstr "%s: Kopiere %d Quellsymbole auf %d Ziele\n"
2 changes: 0 additions & 2 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*.elf
*.bin
*.eep
*.lo
*.la
/elf-mangle
/.deps
/.libs
2 changes: 1 addition & 1 deletion src/image_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ image_write_file(const char *filename,
{
if (! filename || ! blob || ! blob_size) return;

if (DEBUG) printf("%s: Output file \"%s\" format %d\n", __func__, filename, format);
if (DEBUG) printf(_("%s: Output file \"%s\" format %d\n"), __func__, filename, format);
switch (format) {
case formatRawBinary:
image_raw_write_file(filename, blob, blob_size);
Expand Down
2 changes: 1 addition & 1 deletion src/image_ihex_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ image_ihex_merge_file(const char *filename,
} else if (rs->ihrs_count == 0 || start >= end) {
fprintf(stderr, _("Image file \"%s\" is empty\n"), filename);
} else {
if (DEBUG) printf("%s: %s contains range 0x%04" PRIx32 " to 0x%04" PRIx32 "\n",
if (DEBUG) printf(_("%s: %s contains range 0x%04" PRIx32 " to 0x%04" PRIx32 "\n"),
__func__, filename, start, end > 0 ? end - 1 : 0);
if (blob_size > end) {
fprintf(stderr, _("Image file \"%s\" is too small, %zu of %zu bytes missing\n"),
Expand Down
2 changes: 1 addition & 1 deletion src/image_ihex_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ihex_write(
else reclen = default_length;
// Limit to current segment
if (load_offset + reclen > segment_length) reclen = segment_length - load_offset;
if (DEBUG) printf("%s: Record len=%zu source=%p rest=%zu USBA=%" PRIu32 "\n",
if (DEBUG) printf(_("%s: Record len=%zu source=%p rest=%zu USBA=%" PRIu32 "\n"),
__func__, reclen, blob, blob_size, segment_base);

// Write record data
Expand Down
Loading

0 comments on commit 96de54f

Please sign in to comment.