summaryrefslogtreecommitdiff
path: root/mld/link.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-10-04 22:09:01 -0400
committerFreya Murphy <freya@freyacat.org>2024-10-04 22:09:01 -0400
commit9ae3442c85196d7c25d9916520b0c19202a1dd40 (patch)
treec874aab2bf280872276d45f5decf5b7217f9998c /mld/link.c
parentupdate mld,msim with new headers (diff)
downloadmips-9ae3442c85196d7c25d9916520b0c19202a1dd40.tar.gz
mips-9ae3442c85196d7c25d9916520b0c19202a1dd40.tar.bz2
mips-9ae3442c85196d7c25d9916520b0c19202a1dd40.zip
fixed forced section padding in mld
Diffstat (limited to '')
-rw-r--r--mld/link.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/mld/link.c b/mld/link.c
index c56102a..dd3fcc6 100644
--- a/mld/link.c
+++ b/mld/link.c
@@ -565,20 +565,6 @@ static void update_offsets(struct linker *linker)
// sections
for (uint32_t i = 0; i < linker->segments.len; i++) {
struct segment_table_entry *ent = &linker->segments.entries[i];
-
- // section padding
- {
- uint32_t m = ptr % SEC_ALIGN;
- if (m) {
- uint32_t add = SEC_ALIGN - m;
- ptr += add;
- ent->off = ptr;
- ent->padding = add;
- } else {
- ent->padding = 0;
- }
- }
-
uint32_t idx = i + 1;
uint32_t size = segtab_ent_size(ent);
linker->phdr[i].p_offset = B32(ptr);
@@ -634,13 +620,6 @@ static int write_file(struct linker *linker)
// sections
for (uint32_t i = 0; i < linker->segments.len; i++) {
struct segment_table_entry *ent = &linker->segments.entries[i];
- // section padding
- {
- for (uint32_t i = 0; i < ent->padding; i++) {
- uint8_t zero = 0;
- res |= fwrite(&zero, 1, 1, out);
- }
- }
for (uint32_t j = 0; j < ent->len; j++) {
struct segment *seg = ent->parts[j];
res |= fwrite(seg->bytes, 1, seg->size, out);